org.apache.nutch.net.urlnormalizer.ajax

## Class AjaxURLNormalizer

- java.lang.Object
- - org.apache.nutch.net.urlnormalizer.ajax.AjaxURLNormalizer

- All Implemented Interfaces:
    Configurable, URLNormalizer

      public class AjaxURLNormalizer
      extends java.lang.Object
      implements URLNormalizer

  URLNormalizer capable of dealing with AJAX URL's. Use the following regex filter to prevent escaped fragments from being fetched. ^(.*)\?.*_escaped_fragment_

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static java.lang.String` | `AJAX_URL_PART`
    `static java.lang.String` | `ESCAPED_URL_PART`

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

      `X_POINT_ID`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `AjaxURLNormalizer()` Default constructor.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `protected java.lang.String` | `escape(java.lang.String fragmentPart)` Escape some exotic characters in the fragment part
    `Configuration` | `getConf()`
    `java.lang.String` | `normalize(java.lang.String urlString, java.lang.String scope)` Attempts to normalize the input URL string
    `protected java.lang.String` | `normalizeEscapedFragment(java.lang.String urlString)` Returns a normalized input URL.
    `protected java.lang.String` | `normalizeHashedFragment(java.lang.String urlString)` Returns a normalized input URL.
    `void` | `setConf(Configuration conf)`
    `protected java.lang.String` | `unescape(java.lang.String fragmentPart)` Unescape some exotic characters in the fragment part

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

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

- - ### Field Detail

    - #### AJAX_URL_PART

          public static java.lang.String AJAX_URL_PART

    - #### ESCAPED_URL_PART

          public static java.lang.String ESCAPED_URL_PART

  - ### Constructor Detail

    - #### AjaxURLNormalizer

          public AjaxURLNormalizer()

      Default constructor.

  - ### Method Detail

    - #### normalize

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

      Attempts to normalize the input URL string
      Specified by:
        `normalize` in interface `URLNormalizer`
      Parameters:
        `String` - urlString
      Returns:
        String
      Throws:
        `java.net.MalformedURLException`

    - #### normalizeHashedFragment

          protected java.lang.String normalizeHashedFragment(java.lang.String urlString)
                                                      throws java.net.MalformedURLException

      Returns a normalized input URL. #! querystrings are transformed to a _escaped_fragment_ form.
      Parameters:
        `String` - urlString
      Returns:
        String
      Throws:
        `java.net.MalformedURLException`

    - #### normalizeEscapedFragment

          protected java.lang.String normalizeEscapedFragment(java.lang.String urlString)
                                                       throws java.net.MalformedURLException

      Returns a normalized input URL. _escaped_fragment_ querystrings are transformed to a #! form.
      Parameters:
        `String` - urlString
      Returns:
        String
      Throws:
        `java.net.MalformedURLException`

    - #### unescape

          protected java.lang.String unescape(java.lang.String fragmentPart)

      Unescape some exotic characters in the fragment part
      Parameters:
        `String` - fragmentPart
      Returns:
        String

    - #### escape

          protected java.lang.String escape(java.lang.String fragmentPart)

      Escape some exotic characters in the fragment part
      Parameters:
        `String` - fragmentPart
      Returns:
        String

    - #### setConf

          public void setConf(Configuration conf)

      Specified by:
        `setConf` in interface `Configurable`
      Parameters:
        `Configuration` - conf

    - #### getConf

          public Configuration getConf()

      Specified by:
        `getConf` in interface `Configurable`
      Returns:
        Configuration

Copyright © 2019 The Apache Software Foundation