org.apache.nutch.urlfilter.automaton

## 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.
  Author:
    Jérôme Charron
  See Also:
    dk.brics.automaton

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static java.lang.String` | `URLFILTER_AUTOMATON_FILE`
    `static java.lang.String` | `URLFILTER_AUTOMATON_RULES`

    - ### Fields inherited from class org.apache.nutch.urlfilter.api.RegexURLFilterBase

      `hasHostDomainRules`

    - ### Fields inherited from interface org.apache.nutch.net.URLFilter

      `X_POINT_ID`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `AutomatonURLFilter()`
    `AutomatonURLFilter(java.lang.String filename)`

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `protected RegexRule` | `createRule(boolean sign, java.lang.String regex)` Creates a new `RegexRule`.
    `protected RegexRule` | `createRule(boolean sign, java.lang.String regex, java.lang.String hostOrDomain)` Creates a new `RegexRule`.
    `protected java.io.Reader` | `getRulesReader(Configuration conf)` Rules specified as a config property will override rules specified as a config file.
    `static void` | `main(java.lang.String[] args)`

    - ### Methods inherited from class org.apache.nutch.urlfilter.api.RegexURLFilterBase

      `filter, getConf, main, setConf`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### URLFILTER_AUTOMATON_FILE

          public static final java.lang.String URLFILTER_AUTOMATON_FILE

      See Also:
        Constant Field Values

    - #### URLFILTER_AUTOMATON_RULES

          public static final java.lang.String URLFILTER_AUTOMATON_RULES

      See Also:
        Constant Field Values

  - ### Constructor Detail

    - #### AutomatonURLFilter

          public AutomatonURLFilter()

    - #### AutomatonURLFilter

          public AutomatonURLFilter(java.lang.String filename)
                             throws java.io.IOException,
                                    java.util.regex.PatternSyntaxException

      Throws:
        `java.io.IOException`
        `java.util.regex.PatternSyntaxException`

  - ### Method Detail

    - #### getRulesReader

          protected java.io.Reader getRulesReader(Configuration conf)
                                           throws java.io.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:
        `java.io.IOException`

    - #### createRule

          protected RegexRule createRule(boolean sign,
                                         java.lang.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.

    - #### createRule

          protected RegexRule createRule(boolean sign,
                                         java.lang.String regex,
                                         java.lang.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

    - #### main

          public static void main(java.lang.String[] args)
                           throws java.io.IOException

      Throws:
        `java.io.IOException`

Copyright © 2019 The Apache Software Foundation