Package org.apache.nutch.urlfilter.regex
Class RegexURLFilter
java.lang.Object
org.apache.nutch.urlfilter.api.RegexURLFilterBase
org.apache.nutch.urlfilter.regex.RegexURLFilter
- All Implemented Interfaces:
Configurable,URLFilter,Pluggable
- Direct Known Subclasses:
ExemptionUrlFilter
Filters URLs based on a file of regular expressions using the
Java Regex implementation.-
Field Summary
FieldsFields inherited from class org.apache.nutch.urlfilter.api.RegexURLFilterBase
hasHostDomainRulesFields inherited from interface org.apache.nutch.net.URLFilter
X_POINT_ID -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected RegexRulecreateRule(boolean sign, String regex) Creates a newRegexRule.protected RegexRulecreateRule(boolean sign, String regex, String hostOrDomain) Creates a newRegexRule.protected ReadergetRulesReader(Configuration conf) Rules specified as a config property will override rules specified as a config file.static voidMethods inherited from class org.apache.nutch.urlfilter.api.RegexURLFilterBase
filter, getConf, main, setConf
-
Field Details
-
URLFILTER_REGEX_FILE
- See Also:
-
URLFILTER_REGEX_RULES
- See Also:
-
-
Constructor Details
-
RegexURLFilter
public RegexURLFilter() -
RegexURLFilter
- Throws:
IOExceptionPatternSyntaxException
-
-
Method Details
-
getRulesReader
Rules specified as a config property will override rules specified as a config file.- Specified by:
getRulesReaderin classRegexURLFilterBase- Parameters:
conf- is the current configuration.- Returns:
- the name of the resource containing the rules to use.
- Throws:
IOException- if there is a fatal error obtaining theReader
-
createRule
Description copied from class:RegexURLFilterBaseCreates a newRegexRule.- Specified by:
createRulein classRegexURLFilterBase- Parameters:
sign- of the regular expression. Atruevalue means that any URL matching this rule must be included, whereas afalsevalue means that any URL matching this rule must be excluded.regex- is the regular expression associated to this rule.- Returns:
RegexRule
-
createRule
Description copied from class:RegexURLFilterBaseCreates a newRegexRule.- Specified by:
createRulein classRegexURLFilterBase- Parameters:
sign- of the regular expression. Atruevalue means that any URL matching this rule must be included, whereas afalsevalue means that any URL matching this rule must be excluded.regex- is the regular expression associated to this rule.hostOrDomain- the host or domain to which this regex belongs- Returns:
RegexRule
-
main
- Throws:
IOException
-