Class URLPattern

java.lang.Object
javax.security.jacc.URLPattern

class URLPattern extends Object

The representation of a URLPattern in the WebResourcePermission and WebUserDataPermission URLPatternSpecs.

  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    private static enum 
     
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    private String
     
    private int
     
    private String
     
     
  • Constructor Summary

    Constructors
    Constructor
    Description
    URLPattern(String pattern)
    Creates a URLPattern instance from the specified pattern String.
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
     
    (package private) String
    Obtains the String representation of this pattern.
    int
     
    (package private) boolean
    Checks if this pattern is a default (i.e.
    (package private) boolean
    Checks if this pattern is an exact pattern.
    (package private) boolean
    Checks if this pattern is an extension (i.e.
    (package private) boolean
    Checks if this pattern is a prefix (i.e.
    (package private) boolean
    matches(String urlPattern)
    Checks if this pattern matches the specified pattern String.
    (package private) boolean
    Checks if this pattern matches the specified URLPattern.

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
  • Field Details

  • Constructor Details

    • URLPattern

      URLPattern(String pattern)

      Creates a URLPattern instance from the specified pattern String.

      Parameters:
      pattern - the pattern String.
  • Method Details

    • matches

      boolean matches(URLPattern url)

      Checks if this pattern matches the specified URLPattern.

      The matching rules from the WebResourcePermission#implies:

      1. their pattern values are String equivalent, or
      2. this pattern is the path-prefix pattern "/*", or
      3. this pattern is a path-prefix pattern (that is, it starts with "/" and ends with "/*") and the argument pattern starts with the substring of this pattern, minus its last 2 characters, and the next character of the argument pattern, if there is one, is "/", or
      4. this pattern is an extension pattern (that is, it starts with "*.") and the argument pattern ends with this pattern, or 5. the reference pattern is the special default pattern, "/", which matches all argument patterns.

      Parameters:
      url - the URLPattern instance to which this pattern is to be matched.
      Returns:
      true if this pattern matches the specified URLPattern; false otherwise.
    • matches

      boolean matches(String urlPattern)

      Checks if this pattern matches the specified pattern String.

      The matching rules from the WebResourcePermission#implies:

      1. their pattern values are String equivalent, or
      2. this pattern is the path-prefix pattern "/*", or
      3. this pattern is a path-prefix pattern (that is, it starts with "/" and ends with "/*") and the argument pattern starts with the substring of this pattern, minus its last 2 characters, and the next character of the argument pattern, if there is one, is "/", or
      4. this pattern is an extension pattern (that is, it starts with "*.") and the argument pattern ends with this pattern, or 5. the reference pattern is the special default pattern, "/", which matches all argument patterns.

      Parameters:
      urlPattern - a String representing the pattern to which this pattern is to be matched.
      Returns:
      true if this pattern matches the specified URLPattern; false otherwise.
    • getPattern

      String getPattern()

      Obtains the String representation of this pattern.

      Returns:
      this pattern's String representation.
    • isDefault

      boolean isDefault()

      Checks if this pattern is a default (i.e. '/') pattern.

      Returns:
      true if this is a default pattern; false otherwise.
    • isExact

      boolean isExact()

      Checks if this pattern is an exact pattern.

      Returns:
      true if this is an exact pattern; false otherwise.
    • isExtension

      boolean isExtension()

      Checks if this pattern is an extension (i.e. '*.xxx') pattern.

      Returns:
      true if this is an extension pattern; false otherwise.
    • isPrefix

      boolean isPrefix()

      Checks if this pattern is a prefix (i.e. '/*' or '/.../*') pattern.

      Returns:
      true if this is a prefix pattern; false otherwise.
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object