Class URLPatternSpec
- java.lang.Object
-
- javax.security.jacc.URLPatternSpec
-
class URLPatternSpec extends java.lang.Object
Encapsulation of the URLPatternSpec defined in the
WebResourcePermission
andWebUserDataPermission
classes.
-
-
Field Summary
Fields Modifier and Type Field Description (package private) URLPattern
urlPattern
The first or only URLPattern in the specification(package private) java.util.HashSet<URLPattern>
urlPatternList
-
Constructor Summary
Constructors Constructor Description URLPatternSpec(java.lang.String spec)
The specification contains aURLPatternSpec
that identifies the web resources to which the permissions applies.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(java.lang.Object obj)
int
hashCode()
(package private) boolean
implies(URLPatternSpec spec)
Perform the permissionURLPattern
matching: the firstURLPattern
in the name of the argument permission is matched by the firstURLPattern
in the name of this permission. the firstURLPattern
in the name of the argument permission is NOT matched by anyURLPattern
in theURLPatternList
of theURLPatternSpec
of this permission. if the firstURLPattern
in the name of the argument permission matches the firstURLPattern
in theURLPatternSpec
of this permission, then everyURLPattern
in theURLPatternList
of theURLPatternSpec
of this permission is matched by aURLPattern
in theURLPatternList
of the argument permission.
-
-
-
Field Detail
-
urlPattern
URLPattern urlPattern
The first or only URLPattern in the specification
-
urlPatternList
java.util.HashSet<URLPattern> urlPatternList
-
-
Constructor Detail
-
URLPatternSpec
URLPatternSpec(java.lang.String spec)
The specification contains a
URLPatternSpec
that identifies the web resources to which the permissions applies. The syntax of aURLPatternSpec
is as follows:URLPatternList ::= URLPattern | URLPatternList colon URLPattern URLPatternSpec ::= null | URLPattern | URLPattern colon URLPatternList
A null
URLPatternSpec
is translated to the defaultURLPattern
, "/", by the permission constructor. The empty string is an exactURLPattern
, and may occur anywhere in aURLPatternSpec
that an exactURLPattern
may occur. The firstURLPattern
in aURLPatternSpec
may be any of the pattern types, exact, path-prefix, extension, or default as defined in the Java Servlet Specification). When aURLPatternSpec
includes aURLPatternList
, the patterns of theURLPatternList
identify the resources to which the permission does NOT apply and depend on the pattern type and value of the first pattern as follows:- No pattern may exist in the
URLPatternList
that matches the first pattern. - If the first pattern is a path-prefix pattern, only exact patterns matched by the first pattern and
path-prefix patterns matched by, but different from, the first pattern may occur in the
URLPatternList
. - If the first pattern is an extension pattern, only exact patterns that are matched by the first pattern and
path-prefix patterns may occur in the
URLPatternList
. - If the first pattern is the default pattern, "/", any pattern except the default pattern may occur in the
URLPatternList
. - If the first pattern is an exact pattern a
URLPatternList
must not be present in theURLPatternSpec
.
- Parameters:
spec
- theString
representation of theURLPatternSpec
as defined by the JACC specification.
- No pattern may exist in the
-
-
Method Detail
-
implies
boolean implies(URLPatternSpec spec)
Perform the permission
URLPattern
matching:- the first
URLPattern
in the name of the argument permission is matched by the firstURLPattern
in the name of this permission. - the first
URLPattern
in the name of the argument permission is NOT matched by anyURLPattern
in theURLPatternList
of theURLPatternSpec
of this permission. - if the first
URLPattern
in the name of the argument permission matches the firstURLPattern
in theURLPatternSpec
of this permission, then everyURLPattern
in theURLPatternList
of theURLPatternSpec
of this permission is matched by aURLPattern
in theURLPatternList
of the argument permission.
URLPattern
matching is performed using the Servlet matching rules where twoURL
patterns match if they are related as follows:- 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
- the reference pattern is the special default pattern, "/", which matches all argument patterns.
All of the comparisons described above are case sensitive.
- Parameters:
spec
- theURLPatternSpec
to which thisURLPatternSpec
is to be compared.- Returns:
true
if this implies spec;false
otherwise.
- the first
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equals
in classjava.lang.Object
-
-