com.norconex.collector.http.filter.impl
Class ExtensionURLFilter

java.lang.Object
  extended by com.norconex.importer.filter.AbstractOnMatchFilter
      extended by com.norconex.collector.http.filter.impl.ExtensionURLFilter
All Implemented Interfaces:
IHttpDocumentFilter, IHttpHeadersFilter, IURLFilter, IXMLConfigurable, IOnMatchFilter, Serializable

public class ExtensionURLFilter
extends AbstractOnMatchFilter
implements IURLFilter, IHttpDocumentFilter, IHttpHeadersFilter, IXMLConfigurable

Filters URL based on coma-separated list of file extensions.

XML configuration usage:

  <filter class="com.norconex.collector.http.filter.impl.ExtensionURLFilter"
          onMatch="[include|exclude]" 
          caseSensitive="[false|true]" >
      (comma-separated list of extensions)
  </filter>
 

Author:
Pascal Essiembre
See Also:
Serialized Form

Constructor Summary
ExtensionURLFilter()
           
ExtensionURLFilter(String extensions)
           
ExtensionURLFilter(String extensions, OnMatch onMatch)
           
ExtensionURLFilter(String extensions, OnMatch onMatch, boolean caseSensitive)
           
 
Method Summary
 boolean acceptDocument(HttpDocument document)
          Whether to accept a HTTP document.
 boolean acceptDocument(String url, HttpMetadata headers)
          Whether to accept a URL HTTP headers.
 boolean acceptURL(String url)
          Whether to accept this URL.
 boolean equals(Object obj)
           
 String getExtensions()
           
 int hashCode()
           
 boolean isCaseSensitive()
           
 void loadFromXML(Reader in)
           
 void saveToXML(Writer out)
           
 void setCaseSensitive(boolean caseSensitive)
           
 void setExtensions(String extensions)
           
 String toString()
           
 
Methods inherited from class com.norconex.importer.filter.AbstractOnMatchFilter
getOnMatch, loadFromXML, saveToXML, setOnMatch
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ExtensionURLFilter

public ExtensionURLFilter()

ExtensionURLFilter

public ExtensionURLFilter(String extensions)

ExtensionURLFilter

public ExtensionURLFilter(String extensions,
                          OnMatch onMatch)

ExtensionURLFilter

public ExtensionURLFilter(String extensions,
                          OnMatch onMatch,
                          boolean caseSensitive)
Method Detail

acceptURL

public boolean acceptURL(String url)
Description copied from interface: IURLFilter
Whether to accept this URL.

Specified by:
acceptURL in interface IURLFilter
Parameters:
url - the URL to accept/reject
Returns:
true if accepted, false otherwise

getExtensions

public String getExtensions()
Returns:
the extensions

isCaseSensitive

public boolean isCaseSensitive()

setCaseSensitive

public final void setCaseSensitive(boolean caseSensitive)

setExtensions

public final void setExtensions(String extensions)

loadFromXML

public void loadFromXML(Reader in)
Specified by:
loadFromXML in interface IXMLConfigurable

saveToXML

public void saveToXML(Writer out)
               throws IOException
Specified by:
saveToXML in interface IXMLConfigurable
Throws:
IOException

acceptDocument

public boolean acceptDocument(HttpDocument document)
Description copied from interface: IHttpDocumentFilter
Whether to accept a HTTP document.

Specified by:
acceptDocument in interface IHttpDocumentFilter
Parameters:
document - the document to validate
Returns:
true if accepted, false otherwise

acceptDocument

public boolean acceptDocument(String url,
                              HttpMetadata headers)
Description copied from interface: IHttpHeadersFilter
Whether to accept a URL HTTP headers.

Specified by:
acceptDocument in interface IHttpHeadersFilter
Parameters:
url - the URL to accept/reject its headers
headers - HTTP headers associated with the URL
Returns:
true if accepted, false otherwise

toString

public String toString()
Overrides:
toString in class AbstractOnMatchFilter

hashCode

public int hashCode()
Overrides:
hashCode in class AbstractOnMatchFilter

equals

public boolean equals(Object obj)
Overrides:
equals in class AbstractOnMatchFilter


Copyright © 2009-2013 Norconex Inc.. All Rights Reserved.