Class BlacklistEntry


  • public class BlacklistEntry
    extends java.lang.Object
    An 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
    • 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 blacklist
        statusCode - 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 blacklist
        statusCode - status code to return for blacklisted URL
        httpMethodPattern - 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 URL
        httpMethod - 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.