Package javax.security.jacc
Class URLPattern
- java.lang.Object
-
- javax.security.jacc.URLPattern
-
class URLPattern extends java.lang.ObjectThe representation of a URLPattern in the
WebResourcePermissionandWebUserDataPermissionURLPatternSpecs.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description private static classURLPattern.PatternType
-
Field Summary
Fields Modifier and Type Field Description private java.lang.Stringextprivate intlengthprivate java.lang.Stringpatternprivate URLPattern.PatternTypetype
-
Constructor Summary
Constructors Constructor Description URLPattern(java.lang.String pattern)Creates aURLPatterninstance from the specified patternString.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(java.lang.Object o)(package private) java.lang.StringgetPattern()Obtains theStringrepresentation of this pattern.inthashCode()(package private) booleanisDefault()Checks if this pattern is a default (i.e.(package private) booleanisExact()Checks if this pattern is an exact pattern.(package private) booleanisExtension()Checks if this pattern is an extension (i.e.(package private) booleanisPrefix()Checks if this pattern is a prefix (i.e.(package private) booleanmatches(java.lang.String urlPattern)Checks if this pattern matches the specified pattern String.(package private) booleanmatches(URLPattern url)Checks if this pattern matches the specifiedURLPattern.
-
-
-
Field Detail
-
pattern
private java.lang.String pattern
-
ext
private java.lang.String ext
-
length
private int length
-
type
private URLPattern.PatternType type
-
-
Method Detail
-
matches
boolean matches(URLPattern url)
Checks if this pattern matches the specified
URLPattern.The matching rules from the
WebResourcePermission#implies:- their pattern values are
Stringequivalent, or - this pattern is the path-prefix pattern "/*", or
- 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
- 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- theURLPatterninstance to which this pattern is to be matched.- Returns:
trueif this pattern matches the specifiedURLPattern;falseotherwise.
- their pattern values are
-
matches
boolean matches(java.lang.String urlPattern)
Checks if this pattern matches the specified pattern String.
The matching rules from the
WebResourcePermission#implies:- their pattern values are
Stringequivalent, or - this pattern is the path-prefix pattern "/*", or
- 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
- 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- aStringrepresenting the pattern to which this pattern is to be matched.- Returns:
trueif this pattern matches the specifiedURLPattern;falseotherwise.
- their pattern values are
-
getPattern
java.lang.String getPattern()
Obtains the
Stringrepresentation of this pattern.- Returns:
- this pattern's
Stringrepresentation.
-
isDefault
boolean isDefault()
Checks if this pattern is a default (i.e. '/') pattern.
- Returns:
trueif this is a default pattern;falseotherwise.
-
isExact
boolean isExact()
Checks if this pattern is an exact pattern.
- Returns:
trueif this is an exact pattern;falseotherwise.
-
isExtension
boolean isExtension()
Checks if this pattern is an extension (i.e. '*.xxx') pattern.
- Returns:
trueif this is an extension pattern;falseotherwise.
-
isPrefix
boolean isPrefix()
Checks if this pattern is a prefix (i.e. '/*' or '/.../*') pattern.
- Returns:
trueif this is a prefix pattern;falseotherwise.
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
equals
public boolean equals(java.lang.Object o)
- Overrides:
equalsin classjava.lang.Object
-
-