Package com.browserup.bup.proxy
Class BlacklistEntry
- java.lang.Object
-
- com.browserup.bup.proxy.BlacklistEntry
-
public class BlacklistEntry extends java.lang.ObjectAn entry in the Blacklist, consisting of a regular expression to match the URL, an HTTP status code, and a regular expression to match the HTTP method.
-
-
Constructor Summary
Constructors Constructor Description BlacklistEntry(java.lang.String urlPattern, int statusCode)Creates a new BlacklistEntry with no HTTP method matching (i.e.BlacklistEntry(java.lang.String urlPattern, int statusCode, java.lang.String httpMethodPattern)Creates a new BlacklistEntry which will match both a URL and an HTTP method
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description java.util.regex.PatterngetHttpMethodPattern()java.util.regex.PatterngetMethod()Deprecated.java.util.regex.PatterngetPattern()Deprecated.intgetResponseCode()Deprecated.intgetStatusCode()java.util.regex.PatterngetUrlPattern()booleanmatches(java.lang.String url, java.lang.String httpMethod)Determines if this BlacklistEntry matches the given URL.
-
-
-
Constructor Detail
-
BlacklistEntry
public BlacklistEntry(java.lang.String urlPattern, int statusCode)Creates a new BlacklistEntry with no HTTP method matching (i.e. all methods will match).- Parameters:
urlPattern- URL pattern to blackliststatusCode- HTTP status code to return for blacklisted URL
-
BlacklistEntry
public BlacklistEntry(java.lang.String urlPattern, int statusCode, java.lang.String httpMethodPattern)Creates a new BlacklistEntry which will match both a URL and an HTTP method- Parameters:
urlPattern- URL pattern to blackliststatusCode- status code to return for blacklisted URLhttpMethodPattern- HTTP method to match (e.g. GET, PUT, PATCH, etc.)
-
-
Method Detail
-
matches
public boolean matches(java.lang.String url, java.lang.String httpMethod)Determines if this BlacklistEntry matches the given URL. Attempts to match both the URL and the HTTP method.- Parameters:
url- possibly-blacklisted URLhttpMethod- HTTP method this URL is being accessed with- Returns:
- true if the URL matches this BlacklistEntry
-
getUrlPattern
public java.util.regex.Pattern getUrlPattern()
-
getStatusCode
public int getStatusCode()
-
getHttpMethodPattern
public java.util.regex.Pattern getHttpMethodPattern()
-
getPattern
@Deprecated public java.util.regex.Pattern getPattern()
Deprecated.
-
getResponseCode
@Deprecated public int getResponseCode()
Deprecated.
-
getMethod
@Deprecated public java.util.regex.Pattern getMethod()
Deprecated.
-
-