Class URLPatternSpec
Encapsulation of the URLPatternSpec defined in the WebResourcePermission and
WebUserDataPermission classes.
-
Field Summary
FieldsModifier and TypeFieldDescription(package private) URLPatternThe first or only URLPattern in the specification(package private) HashSet<URLPattern> -
Constructor Summary
ConstructorsConstructorDescriptionURLPatternSpec(String spec) The specification contains aURLPatternSpecthat identifies the web resources to which the permissions applies. -
Method Summary
Modifier and TypeMethodDescriptionbooleaninthashCode()(package private) booleanimplies(URLPatternSpec spec) Perform the permissionURLPatternmatching: the firstURLPatternin the name of the argument permission is matched by the firstURLPatternin the name of this permission. the firstURLPatternin the name of the argument permission is NOT matched by anyURLPatternin theURLPatternListof theURLPatternSpecof this permission. if the firstURLPatternin the name of the argument permission matches the firstURLPatternin theURLPatternSpecof this permission, then everyURLPatternin theURLPatternListof theURLPatternSpecof this permission is matched by aURLPatternin theURLPatternListof the argument permission.
-
Field Details
-
urlPattern
URLPattern urlPatternThe first or only URLPattern in the specification -
urlPatternList
HashSet<URLPattern> urlPatternList
-
-
Constructor Details
-
URLPatternSpec
URLPatternSpec(String spec) The specification contains a
URLPatternSpecthat identifies the web resources to which the permissions applies. The syntax of aURLPatternSpecis as follows:URLPatternList ::= URLPattern | URLPatternList colon URLPattern URLPatternSpec ::= null | URLPattern | URLPattern colon URLPatternList
A null
URLPatternSpecis translated to the defaultURLPattern, "/", by the permission constructor. The empty string is an exactURLPattern, and may occur anywhere in aURLPatternSpecthat an exactURLPatternmay occur. The firstURLPatternin aURLPatternSpecmay be any of the pattern types, exact, path-prefix, extension, or default as defined in the Java Servlet Specification). When aURLPatternSpecincludes aURLPatternList, the patterns of theURLPatternListidentify 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
URLPatternListthat 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
URLPatternListmust not be present in theURLPatternSpec.
- Parameters:
spec- theStringrepresentation of theURLPatternSpecas defined by the JACC specification.
- No pattern may exist in the
-
-
Method Details
-
implies
Perform the permission
URLPatternmatching:- the first
URLPatternin the name of the argument permission is matched by the firstURLPatternin the name of this permission. - the first
URLPatternin the name of the argument permission is NOT matched by anyURLPatternin theURLPatternListof theURLPatternSpecof this permission. - if the first
URLPatternin the name of the argument permission matches the firstURLPatternin theURLPatternSpecof this permission, then everyURLPatternin theURLPatternListof theURLPatternSpecof this permission is matched by aURLPatternin theURLPatternListof the argument permission.
URLPatternmatching is performed using the Servlet matching rules where twoURLpatterns match if they are related as follows:- 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
- the reference pattern is the special default pattern, "/", which matches all argument patterns.
All of the comparisons described above are case sensitive.
- Parameters:
spec- theURLPatternSpecto which thisURLPatternSpecis to be compared.- Returns:
trueif this implies spec;falseotherwise.
- the first
-
hashCode
public int hashCode() -
equals
-