Class AjaxURLNormalizer
java.lang.Object
org.apache.nutch.net.urlnormalizer.ajax.AjaxURLNormalizer
- All Implemented Interfaces:
Configurable,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
FieldsFields inherited from interface org.apache.nutch.net.URLNormalizer
X_POINT_ID -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected StringEscape some exotic characters in the fragment partgetConf()Attempts to normalize the input URL stringprotected StringnormalizeEscapedFragment(String urlString) Returns a normalized input URL.protected StringnormalizeHashedFragment(String urlString) Returns a normalized input URL.voidsetConf(Configuration conf) protected StringUnescape some exotic characters in the fragment part
-
Field Details
-
AJAX_URL_PART
-
ESCAPED_URL_PART
-
-
Constructor Details
-
AjaxURLNormalizer
public AjaxURLNormalizer()Default constructor.
-
-
Method Details
-
normalize
Attempts to normalize the input URL string- Specified by:
normalizein interfaceURLNormalizer- Parameters:
urlString- a String to processscope- used when indexing URLs- Returns:
- String
- Throws:
MalformedURLException- if the urlString is malformed
-
normalizeHashedFragment
Returns a normalized input URL. #! querystrings are transformed to a _escaped_fragment_ form.- Parameters:
urlString- a String to process- Returns:
- String
- Throws:
MalformedURLException- if the urlString is malformed
-
normalizeEscapedFragment
Returns a normalized input URL. _escaped_fragment_ querystrings are transformed to a #! form.- Parameters:
urlString- a String to process- Returns:
- String
- Throws:
MalformedURLException- if the urlString is malformed
-
unescape
Unescape some exotic characters in the fragment part- Parameters:
fragmentPart- a String to process- Returns:
- String
-
escape
Escape some exotic characters in the fragment part- Parameters:
fragmentPart- a String to process- Returns:
- String
-
setConf
- Specified by:
setConfin interfaceConfigurable- Parameters:
conf- a populatedConfiguration
-
getConf
- Specified by:
getConfin interfaceConfigurable- Returns:
- Configuration
-