SMILA 1.0 API documentation

org.eclipse.smila.importing.crawler.web.filter
Class DefaultLinkFilter

java.lang.Object
  extended by org.eclipse.smila.importing.crawler.web.filter.DefaultLinkFilter
All Implemented Interfaces:
LinkFilter

public class DefaultLinkFilter
extends java.lang.Object
implements LinkFilter

Default @ LinkFilter} implementation.


Constructor Summary
DefaultLinkFilter()
           
 
Method Summary
 boolean allowLink(java.lang.String url, WebCrawlingContext context)
          Check if it is allowed to follow a given link.
 java.util.Collection<Record> filterLinks(java.util.Collection<Record> extractedLinks, WebCrawlingContext context)
          filter extracted links.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultLinkFilter

public DefaultLinkFilter()
Method Detail

filterLinks

public java.util.Collection<Record> filterLinks(java.util.Collection<Record> extractedLinks,
                                                WebCrawlingContext context)
                                         throws WebCrawlerException
Description copied from interface: LinkFilter
filter extracted links.

Specified by:
filterLinks in interface LinkFilter
Parameters:
extractedLinks - result from LinkExtractor service.
context - the WebCrawlingContext.
Returns:
links to follow in follow-up tasks
Throws:
WebCrawlerException - error in processing the links.

allowLink

public boolean allowLink(java.lang.String url,
                         WebCrawlingContext context)
                  throws WebCrawlerException
Description copied from interface: LinkFilter
Check if it is allowed to follow a given link.

Specified by:
allowLink in interface LinkFilter
Parameters:
url - a String containing the link to be checked
context - the WebCrawlingContext.
Returns:
true if the link is allowed to be followed, false otherwise
Throws:
WebCrawlerException - error in processing the links.

SMILA 1.0 API documentation