|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.norconex.importer.filter.AbstractOnMatchFilter
com.norconex.collector.http.filter.impl.RegexURLFilter
public class RegexURLFilter
Filters URL based on a regular expression.
XML configuration usage:
<filter class="com.norconex.collector.http.filter.impl.RegexURLFilter" onMatch="[include|exclude]" caseSensitive="[false|true]" > (regular expression) </filter>
Constructor Summary | |
---|---|
RegexURLFilter()
|
|
RegexURLFilter(String regex)
|
|
RegexURLFilter(String regex,
OnMatch onMatch)
|
|
RegexURLFilter(String regex,
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 |
getRegex()
|
int |
hashCode()
|
boolean |
isCaseSensitive()
|
void |
loadFromXML(Reader in)
|
void |
saveToXML(Writer out)
|
void |
setCaseSensitive(boolean caseSensitive)
|
void |
setRegex(String regex)
|
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 |
---|
public RegexURLFilter()
public RegexURLFilter(String regex)
public RegexURLFilter(String regex, OnMatch onMatch)
public RegexURLFilter(String regex, OnMatch onMatch, boolean caseSensitive)
Method Detail |
---|
public String getRegex()
public boolean isCaseSensitive()
public final void setCaseSensitive(boolean caseSensitive)
public final void setRegex(String regex)
public boolean acceptURL(String url)
IURLFilter
acceptURL
in interface IURLFilter
url
- the URL to accept/reject
true
if accepted, false
otherwisepublic void loadFromXML(Reader in)
loadFromXML
in interface IXMLConfigurable
public void saveToXML(Writer out) throws IOException
saveToXML
in interface IXMLConfigurable
IOException
public boolean acceptDocument(HttpDocument document)
IHttpDocumentFilter
acceptDocument
in interface IHttpDocumentFilter
document
- the document to validate
true
if accepted, false
otherwisepublic boolean acceptDocument(String url, HttpMetadata headers)
IHttpHeadersFilter
acceptDocument
in interface IHttpHeadersFilter
url
- the URL to accept/reject its headersheaders
- HTTP headers associated with the URL
true
if accepted, false
otherwisepublic String toString()
toString
in class AbstractOnMatchFilter
public int hashCode()
hashCode
in class AbstractOnMatchFilter
public boolean equals(Object obj)
equals
in class AbstractOnMatchFilter
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |