public class Whitelist extends Object
Modifier and Type | Field and Description |
---|---|
static Whitelist |
WHITELIST_DISABLED
A disabled Whitelist.
|
Constructor and Description |
---|
Whitelist()
Creates an empty, disabled Whitelist.
|
Whitelist(Collection<String> patterns,
int statusCode)
Creates a whitelist for the specified patterns, returning the given statusCode when a URL does not match one of the patterns.
|
Whitelist(int statusCode)
Creates an empty, enabled whitelist with the specified response code.
|
Whitelist(String[] patterns,
int statusCode)
Deprecated.
|
Modifier and Type | Method and Description |
---|---|
Collection<Pattern> |
getPatterns() |
int |
getResponseCode()
Deprecated.
use
getStatusCode() |
int |
getStatusCode() |
boolean |
isEnabled() |
boolean |
matches(String url)
Returns true if the specified URL matches a whitelisted URL regular expression.
|
public static final Whitelist WHITELIST_DISABLED
public Whitelist()
public Whitelist(int statusCode)
statusCode
- the response code that the (enabled) Whitelist will return for all URLs.@Deprecated public Whitelist(String[] patterns, int statusCode)
Whitelist(java.util.Collection, int)
public Whitelist(Collection<String> patterns, int statusCode)
patterns
- URL-matching regular expression patterns to whiteliststatusCode
- the HTTP status code to return when a request URL matches a whitelist patternpublic boolean isEnabled()
public Collection<Pattern> getPatterns()
public int getStatusCode()
@Deprecated public int getResponseCode()
getStatusCode()
public boolean matches(String url)
url
- URL to match against the whitelistCopyright © 2016. All Rights Reserved.