Class PrefixURLFilter

java.lang.Object
org.apache.nutch.urlfilter.prefix.PrefixURLFilter
All Implemented Interfaces:
Configurable, URLFilter, Pluggable

public class PrefixURLFilter extends Object implements URLFilter
Filters URLs based on a file of URL prefixes. The file is named by (1) property "urlfilter.prefix.file" in ./conf/nutch-default.xml, or (2) the attribute "file" in plugin.xml of this plugin.

The format of this file is one URL prefix per line.

  • Constructor Details

  • Method Details

    • filter

      public String filter(String url)
      Description copied from interface: URLFilter
      Interface for a filter that transforms a URL: it can pass the original URL through or "delete" the URL by returning null
      Specified by:
      filter in interface URLFilter
      Parameters:
      url - the URL string the filter is applied on
      Returns:
      the original URL string if the URL is accepted by the filter or null in case the URL is rejected
    • main

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

      public void setConf(Configuration conf)
      Specified by:
      setConf in interface Configurable
    • getConf

      public Configuration getConf()
      Specified by:
      getConf in interface Configurable