com.antelmann.net.mail
Class MailScanner
java.lang.Object
com.antelmann.net.mail.MailScanner
- All Implemented Interfaces:
- CrawlerSetting
public class MailScanner
- extends Object
- implements CrawlerSetting
A class that must NOT be used for spamming, but there are several other useful purposes.
- Author:
- Holger Antelmann
|
Constructor Summary |
MailScanner(int maxDepth,
int maxClosed)
|
|
Method Summary |
boolean |
followLinks(URL url,
URL referer,
int depth,
List<URL> resultURLList,
List<URL> closedURLList,
List<Spider.URLWrapper> searchURLWrapperList)
followLinks() determines whether the given URL is to be searched for
its links to be examined further in the next level. |
HashSet<javax.mail.internet.InternetAddress> |
getAddresses()
|
boolean |
matchesCriteria(URL url,
URL referer,
int depth,
List<URL> resultURLList,
List<URL> closedURLList)
This method decides whether either the URL itself or its content qualifies
for what this CrawlerSetting searches for; as this function is also called on every
URL encountered, it is also the place for any custom parsing this CrawlerSetting
wants to do. |
static javax.mail.internet.InternetAddress[] |
scanForAddresses(Email email)
|
static javax.mail.internet.InternetAddress[] |
scanForAddresses(LocalWeb web)
|
static javax.mail.internet.InternetAddress[] |
scanForAddresses(String text)
|
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
MailScanner
public MailScanner(int maxDepth,
int maxClosed)
matchesCriteria
public boolean matchesCriteria(URL url,
URL referer,
int depth,
List<URL> resultURLList,
List<URL> closedURLList)
- Description copied from interface:
CrawlerSetting
- This method decides whether either the URL itself or its content qualifies
for what this CrawlerSetting searches for; as this function is also called on every
URL encountered, it is also the place for any custom parsing this CrawlerSetting
wants to do.
The two List objects allow the CrawlerSetting to act on potential constrains
that may result from e.g. a maximum number of total nodes to be examined
(or any other custom checking imaginable).
Note that it is the responsibility of the calling object to ensure that
this function isn't called multiple times on the same URL if that's not
desired.
The url may include any URL, including non-HTTP protocols
(such as mailto:, ftp:) and image or media URLs
- Specified by:
matchesCriteria in interface CrawlerSetting
- Parameters:
url - the URL in question to satisfy the criteriareferer - url's referer URLdepth - link distance from the original root URL where the search beganresultURLList - List of URLs that have already been found to match this CrawlerSetting's criteriaclosedURLList - List of URLs that have already been found not to match the CrawlerSetting's criteria
followLinks
public boolean followLinks(URL url,
URL referer,
int depth,
List<URL> resultURLList,
List<URL> closedURLList,
List<Spider.URLWrapper> searchURLWrapperList)
- Description copied from interface:
CrawlerSetting
- followLinks() determines whether the given URL is to be searched for
its links to be examined further in the next level.
The three List objects allow the CrawlerSetting to act on potential constrains
that may result from e.g. a maximum number of total nodes to be examined
(or any other custom checking imaginable).
The url may include any URL, including non-HTTP protocols
(such as mailto:, ftp:) and image or media URLs.
- Specified by:
followLinks in interface CrawlerSetting
- Parameters:
url - the URL that is to be examined for its linksreferer - url's referer URLdepth - distance from the original root URL where the search beganresultURLList - List of URLs that have already been found to match this CrawlerSetting's criteriaclosedURLList - List of URLs that have already been found not to match the CrawlerSetting's criteriasearchURLWrapperList - List of Spider.URLWrapper objects already identified to be examined in the next level- See Also:
Spider.URLWrapper
getAddresses
public HashSet<javax.mail.internet.InternetAddress> getAddresses()
scanForAddresses
public static javax.mail.internet.InternetAddress[] scanForAddresses(Email email)
scanForAddresses
public static javax.mail.internet.InternetAddress[] scanForAddresses(LocalWeb web)
scanForAddresses
public static javax.mail.internet.InternetAddress[] scanForAddresses(String text)
(c) Holger Antelmann since 2001- all rights reserved (contact: info@antelmann.com)
see www.antelmann.com/developer for further details and available downloads