Package javax.security.jacc
Class URLPattern
- java.lang.Object
-
- javax.security.jacc.URLPattern
-
class URLPattern extends java.lang.Object
The representation of a URLPattern in the
WebResourcePermission
andWebUserDataPermission
URLPatternSpecs.- See Also:
WebResourcePermission
,WebUserDataPermission
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description private static class
URLPattern.PatternType
-
Field Summary
Fields Modifier and Type Field Description private java.lang.String
ext
private int
length
private java.lang.String
pattern
private URLPattern.PatternType
type
-
Constructor Summary
Constructors Constructor Description URLPattern(java.lang.String pattern)
Creates aURLPattern
instance from the specified patternString
.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(java.lang.Object o)
(package private) java.lang.String
getPattern()
Obtains theString
representation of this pattern.int
hashCode()
(package private) boolean
isDefault()
Checks if this pattern is a default (i.e.(package private) boolean
isExact()
Checks if this pattern is an exact pattern.(package private) boolean
isExtension()
Checks if this pattern is an extension (i.e.(package private) boolean
isPrefix()
Checks if this pattern is a prefix (i.e.(package private) boolean
matches(java.lang.String urlPattern)
Checks if this pattern matches the specified pattern String.(package private) boolean
matches(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
String
equivalent, 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
- theURLPattern
instance to which this pattern is to be matched.- Returns:
true
if this pattern matches the specifiedURLPattern
;false
otherwise.
- 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
String
equivalent, 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
- aString
representing the pattern to which this pattern is to be matched.- Returns:
true
if this pattern matches the specifiedURLPattern
;false
otherwise.
- their pattern values are
-
getPattern
java.lang.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 classjava.lang.Object
-
equals
public boolean equals(java.lang.Object o)
- Overrides:
equals
in classjava.lang.Object
-
-