public class HttpPrefixFetchFilter extends FetchFilter
FetchFilter
that filters based on a HTTP or HTTPS URI
.
The filtered URI
s are required to start with the URI
(the prefix) to be
considered valid.
checkFilter(URI)
FetchFilter.FetchStatus
log
Constructor and Description |
---|
HttpPrefixFetchFilter(org.apache.commons.httpclient.URI prefix)
Constructs a
HttpPrefixFetchFilter using the given URI as prefix. |
Modifier and Type | Method and Description |
---|---|
FetchFilter.FetchStatus |
checkFilter(org.apache.commons.httpclient.URI uri)
Filters any URI that does not start with the defined prefix.
|
String |
getNormalisedPrefix()
Gets the prefix normalised, as it is used to filter the
URI s. |
getLogger
public HttpPrefixFetchFilter(org.apache.commons.httpclient.URI prefix)
HttpPrefixFetchFilter
using the given URI
as prefix.
The user info, query component and fragment of the given URI
are discarded. The
scheme and domain comparisons are done in a case insensitive way while the path component
comparison is case sensitive.
prefix
- the URI
that will be used as prefixIllegalArgumentException
- if any of the following conditions is true
:
prefix
is null
;
prefix
has null
scheme;
prefix
is not HTTP or HTTPS;
prefix
has null
host;
prefix
has malformed host.
public String getNormalisedPrefix()
URI
s.String
with the prefix normalisedcheckFilter(URI)
public FetchFilter.FetchStatus checkFilter(org.apache.commons.httpclient.URI uri)
checkFilter
in class FetchFilter
uri
- the uri to be processedFetchStatus.VALID
if the uri
starts with the prefix
, FetchStatus.OUT_OF_SCOPE
otherwise