Class AutomatonURLFilter

java.lang.Object
org.apache.nutch.urlfilter.api.RegexURLFilterBase
org.apache.nutch.urlfilter.automaton.AutomatonURLFilter
All Implemented Interfaces:
Configurable, URLFilter, Pluggable

public class AutomatonURLFilter extends RegexURLFilterBase
RegexURLFilterBase implementation based on the dk.brics.automaton Finite-State Automata for JavaTM.
See Also:
  • Field Details

  • Constructor Details

  • Method Details

    • getRulesReader

      protected Reader getRulesReader(Configuration conf) throws IOException
      Rules specified as a config property will override rules specified as a config file.
      Specified by:
      getRulesReader in class RegexURLFilterBase
      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 the Reader
    • createRule

      protected RegexRule createRule(boolean sign, String regex)
      Description copied from class: RegexURLFilterBase
      Creates a new RegexRule.
      Specified by:
      createRule in class RegexURLFilterBase
      Parameters:
      sign - of the regular expression. A true value means that any URL matching this rule must be included, whereas a false value means that any URL matching this rule must be excluded.
      regex - is the regular expression associated to this rule.
      Returns:
      RegexRule
    • createRule

      protected RegexRule createRule(boolean sign, String regex, String hostOrDomain)
      Description copied from class: RegexURLFilterBase
      Creates a new RegexRule.
      Specified by:
      createRule in class RegexURLFilterBase
      Parameters:
      sign - of the regular expression. A true value means that any URL matching this rule must be included, whereas a false value 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

      public static void main(String[] args) throws IOException
      Throws:
      IOException