org.apache.nutch.net.urlnormalizer.host

## Class HostURLNormalizer

- java.lang.Object
- - org.apache.nutch.net.urlnormalizer.host.HostURLNormalizer

- All Implemented Interfaces:
    Configurable, URLNormalizer

      public class HostURLNormalizer
      extends java.lang.Object
      implements URLNormalizer

  URL normalizer for mapping hosts to their desired form. It takes a simple text file as source in the format: example.org www.example.org mapping all URL's of example.org the the www sub-domain. It also allows for wildcards to be used to map all sub-domains to another host: *.example.org www.example.org

- - ### Field Summary

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

      `X_POINT_ID`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `HostURLNormalizer()`
    `HostURLNormalizer(java.lang.String hostsFile)`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `Configuration` | `getConf()`
    `java.lang.String` | `normalize(java.lang.String urlString, java.lang.String scope)`
    `protected java.lang.String` | `replaceHost(java.lang.String urlString, java.lang.String host, java.lang.String target)`
    `void` | `setConf(Configuration conf)`

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

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

- - ### Constructor Detail

    - #### HostURLNormalizer

          public HostURLNormalizer()

    - #### HostURLNormalizer

          public HostURLNormalizer(java.lang.String hostsFile)

  - ### Method Detail

    - #### getConf

          public Configuration getConf()

      Specified by:
        `getConf` in interface `Configurable`

    - #### setConf

          public void setConf(Configuration conf)

      Specified by:
        `setConf` in interface `Configurable`

    - #### normalize

          public java.lang.String normalize(java.lang.String urlString,
                                            java.lang.String scope)
                                     throws java.net.MalformedURLException

      Specified by:
        `normalize` in interface `URLNormalizer`
      Throws:
        `java.net.MalformedURLException`

    - #### replaceHost

          protected java.lang.String replaceHost(java.lang.String urlString,
                                                 java.lang.String host,
                                                 java.lang.String target)

Copyright © 2019 The Apache Software Foundation