Top Description Fields Constructors Methods
javax.security.jacc

pack-priv Class URLPatternSpec

extends URLPattern
Class Inheritance
Imports
java.util.Arrays

This class extends the URLPattern class and is used to represent URLPatternSpec objects. URLPatternSpec objects occur within WebResourcePermission and WebUserDataPermission objects.

Authors
Ron Monzillo, Gary Ellison

Field Summary

Modifier and TypeField and Description
private String
private static String
private transient int
private URLPattern[]
private final String
Inherited from javax.security.jacc.URLPattern:
PT_DEFAULTPT_EXACTPT_EXTENSIONPT_PREFIX

Constructor Summary

AccessConstructor and Description
public
URLPatternSpec(String
a String containing a URLPatternSpec that identifies the application specific web resources to which the permission pertains. All URLPatterns in the URLPatternSpec are relative to the context path of the deployed web application module, and the same URLPattern must not occur more than once in a URLPatternSpec.
urlPatternSpec
)

Creates a new URLPatternSpec that identifies the web resources to which a WebResourcePermission or WebUserDataPermission applies.

Method Summary

Modifier and TypeMethod and Description
public boolean
equals(Object
the reference object with which to compare.
o
)

Overrides javax.security.jacc.URLPattern.equals.

Indicates whether some other object is "equal to" this one.
private static String
getFirstPattern(String urlPatternSpec)

public String
getURLPattern()

This method returns a String containing the first URLPattern in this URLPatternSpec.

public int

Returns:

the integer hash code value for this object.
hashCode
()

Overrides java.lang.Object.hashCode.

Returns the hash code value for this URLPatternSpec properties of the returned hash code must be as follows:

  • During the lifetime of a Java application, the hashCode method must return the same integer value, every time it is called on a URLPatternSpec object. The value returned by hashCode for a particular URlPatternSpec need not remain consistent from one execution of an application to another.
  • If two URLPatternSpec objects are equal according to the equals method, then calling the hashCode method on each of the two objects must produce the same integer result (within an application).
public boolean

Returns:

true if the specified URLPatternSpec is implied by this URLPatternSpec, false if not.
implies
(URLPatternSpec
"this" URLPatternSpec is checked to see if it implies the argument URLPatternSpec.

that
)

Determines if the argument URLPatternSpec is "implied by" this URLPatternSpec.

private void
public String
toString()

Overrides javax.security.jacc.URLPattern.toString.

Returns a string representation of the object.
Inherited from javax.security.jacc.URLPattern:
compareTogetPatternDepthimpliespatternType

Field Detail

canonicalSpecback to summary
private String canonicalSpec
EMPTY_STRINGback to summary
private static String EMPTY_STRING
hashCodeValueback to summary
private transient int hashCodeValue
urlPatternArrayback to summary
private URLPattern[] urlPatternArray
urlPatternListback to summary
private final String urlPatternList

Constructor Detail

URLPatternSpecback to summary
public URLPatternSpec(String urlPatternSpec)

Creates a new URLPatternSpec that identifies the web resources to which a WebResourcePermission or WebUserDataPermission applies. The syntax of the name parameter is as follows:


         URLPatternList ::= URLPattern | URLPatternList colon URLPattern

         URLPatternSpec ::= URLPattern | URLPattern colon URLPatternList

         name ::= URLPatternSpec

The first URLPattern in a URLPatternSpec may be any of the pattern types, exact, path-prefix, extension, or default as defined in the Java Servlet Specification). When a URLPatternSpec includes a URLPatternList, the patterns of the URLPatternList 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 the URLPatternSpec.

Parameters
urlPatternSpec:String

a String containing a URLPatternSpec that identifies the application specific web resources to which the permission pertains. All URLPatterns in the URLPatternSpec are relative to the context path of the deployed web application module, and the same URLPattern must not occur more than once in a URLPatternSpec.

Method Detail

equalsback to summary
public boolean equals(Object o)

Overrides javax.security.jacc.URLPattern.equals.

Doc from java.lang.Object.equals.

Indicates whether some other object is "equal to" this one.

The equals method implements an equivalence relation on non-null object references:

  • It is reflexive: for any non-null reference value x, x.equals(x) should return true.
  • It is symmetric: for any non-null reference values x and y, x.equals(y) should return true if and only if y.equals(x) returns true.
  • It is transitive: for any non-null reference values x, y, and z, if x.equals(y) returns true and y.equals(z) returns true, then x.equals(z) should return true.
  • It is consistent: for any non-null reference values x and y, multiple invocations of x.equals(y) consistently return true or consistently return false, provided no information used in equals comparisons on the objects is modified.
  • For any non-null reference value x, x.equals(null) should return false.

An equivalence relation partitions the elements it operates on into equivalence classes; all the members of an equivalence class are equal to each other. Members of an equivalence class are substitutable for each other, at least for some purposes.

Parameters
o:Object

the reference object with which to compare.

Returns:boolean

true if this object is the same as the obj argument; false otherwise.

getFirstPatternback to summary
private static String getFirstPattern(String urlPatternSpec)
getURLPatternback to summary
public String getURLPattern()

This method returns a String containing the first URLPattern in this URLPatternSpec.

hashCodeback to summary
public int hashCode()

Overrides java.lang.Object.hashCode.

Returns the hash code value for this URLPatternSpec properties of the returned hash code must be as follows:

  • During the lifetime of a Java application, the hashCode method must return the same integer value, every time it is called on a URLPatternSpec object. The value returned by hashCode for a particular URlPatternSpec need not remain consistent from one execution of an application to another.
  • If two URLPatternSpec objects are equal according to the equals method, then calling the hashCode method on each of the two objects must produce the same integer result (within an application).

Returns:int

the integer hash code value for this object.

impliesback to summary
public boolean implies(URLPatternSpec that)

Determines if the argument URLPatternSpec is "implied by" this URLPatternSpec. For this to be the case, all of the following must be true:

  • The argument is an instanceof URLPatternSpec, and
  • The first Pattern in the argument URLPatternSpec is matched by the first URLPattern of this URLPatternSpec.
  • The first Pattern in the argument URLPatternSpec is NOT matched by any URLPattern in the URLPatternList of this URLPatternSpec.
  • If the first Pattern in the argument URLPatternSpec matches the first Pattern in this URLPatternSpec, then every URLPattern in the URLPatternList of this URLPatternSpec is matched by a URLPattern in the URLPatternList of the argument URLPatternSpec.

URLPattern matching is performed using the Servlet matching rules where two URL 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
that:URLPatternSpec

"this" URLPatternSpec is checked to see if it implies the argument URLPatternSpec.

Returns:boolean

true if the specified URLPatternSpec is implied by this URLPatternSpec, false if not.

setURLPatternArrayback to summary
private void setURLPatternArray()
toStringback to summary
public String toString()

Overrides javax.security.jacc.URLPattern.toString.

Doc from java.lang.Object.toString.

Returns a string representation of the object.

Returns:String

a string representation of the object.