Class DomainURLFilter
- All Implemented Interfaces:
Configurable,URLFilter,Pluggable
Filters URLs based on a file containing domain suffixes, domain names, and hostnames. Only a URL that matches one of the suffixes, domains, or hosts present in the file is allowed.
URLs are checked in order of domain suffix, domain name, and hostname against entries in the domain file. The domain file would be setup as follows with one entry per line:
com apache.org www.apache.org
The first line is an example of a filter that would allow all .com domains. The second line allows all URLs from apache.org and all of its subdomains such as lucene.apache.org and hadoop.apache.org. The third line would allow only URLs from www.apache.org. There is no specific ordering to entries. The entries are from more general to more specific with the more general overriding the more specific.
The domain file defaults to domain-urlfilter.txt in the classpath but can be overridden using the:- property "urlfilter.domain.file" in ./conf/nutch-*.xml, and
- attribute "file" in plugin.xml of this plugin
-
Field Summary
Fields inherited from interface org.apache.nutch.net.URLFilter
X_POINT_ID -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionInterface for a filter that transforms a URL: it can pass the original URL through or "delete" the URL by returning nullgetConf()voidsetConf(Configuration conf) Sets the configuration.
-
Constructor Details
-
DomainURLFilter
public DomainURLFilter()
-
-
Method Details
-
setConf
Sets the configuration.- Specified by:
setConfin interfaceConfigurable
-
getConf
- Specified by:
getConfin interfaceConfigurable
-
filter
Description copied from interface:URLFilterInterface for a filter that transforms a URL: it can pass the original URL through or "delete" the URL by returning null
-