Package javax.security.jacc
Class URLPattern
java.lang.Object
javax.security.jacc.URLPattern
The representation of a URLPattern in the WebResourcePermission and WebUserDataPermission
URLPatternSpecs.
-
Nested Class Summary
Nested Classes -
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionURLPattern(String pattern) Creates aURLPatterninstance from the specified patternString. -
Method Summary
Modifier and TypeMethodDescriptionboolean(package private) StringObtains theStringrepresentation of this pattern.inthashCode()(package private) booleanChecks if this pattern is a default (i.e.(package private) booleanisExact()Checks if this pattern is an exact pattern.(package private) booleanChecks if this pattern is an extension (i.e.(package private) booleanisPrefix()Checks if this pattern is a prefix (i.e.(package private) booleanChecks if this pattern matches the specified pattern String.(package private) booleanmatches(URLPattern url) Checks if this pattern matches the specifiedURLPattern.
-
Field Details
-
pattern
-
ext
-
length
private int length -
type
-
-
Constructor Details
-
URLPattern
URLPattern(String pattern) Creates a
URLPatterninstance from the specified patternString.- Parameters:
pattern- the patternString.
-
-
Method Details
-
matches
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
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
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() -
equals
-