public final class WebResourcePermission extends Permission implements Serializable
Constructor and Description |
---|
WebResourcePermission(javax.servlet.http.HttpServletRequest request)
Creates a new WebResourcePermission from the HttpServletRequest object.
|
WebResourcePermission(String name,
String actions)
Creates a new WebResourcePermission with the specified name and actions.
|
WebResourcePermission(String urlPatternSpec,
String[] httpMethods)
Creates a new WebResourcePermission with name corresponding to the
URLPatternSpec, and actions composed from the array of HTTP methods.
|
Modifier and Type | Method and Description |
---|---|
boolean |
equals(Object p)
Checks two WebResourcePermission objects for equality.
|
String |
getActions()
Returns a canonical String representation of the actions of this
WebResourcePermission.
|
int |
hashCode()
Returns the hash code value for this WebResourcePermission.
|
boolean |
implies(Permission p)
Determines if the argument Permission is "implied by" this
WebResourcePermission.
|
checkGuard, getName, newPermissionCollection, toString
public WebResourcePermission(javax.servlet.http.HttpServletRequest request)
request
- - the HttpServletRequest object corresponding to the
Servlet operation to which the permission pertains. The permission name is
the substring of the requestURI (HttpServletRequest.getRequestURI()) that
begins after the contextPath (HttpServletRequest.getContextPath()). When
the substring operation yields the string "/", the permission is
constructed with the empty string as its name. The permission's actions
field is obtained from HttpServletRequest.getMethod().public WebResourcePermission(String name, String actions)
name
- - the 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. A null URLPatternSpec is translated to the default
URLPattern, "/", by the permission constructor.actions
- - identifies the HTTP methods to which the permission
pertains. If the value passed through this parameter is null or the empty
string, then the permission is constructed with actions corresponding to
all the possible HTTP methods.public WebResourcePermission(String urlPatternSpec, String[] httpMethods)
urlPatternSpec
- - the URLPatternSpec that identifies the app
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. A null URLPatternSpec is translated to the default
URLPattern, "/", by the permission constructor.httpMethods
- - an array of strings each element of which contains
the value of an HTTP method. If the value passed through this parameter is
null or is an array with no elements, then the permission is constructed
with actions corresponding to all the possible HTTP methods.public boolean equals(Object p)
equals
in class Permission
p
- - the WebResourcePermission object being tested for equality
with this WebResourcePermission.public String getActions()
getActions
in class Permission
public int hashCode()
hashCode
in class Permission
public boolean implies(Permission p)
implies
in class Permission
p
- Copyright © 2012 JBoss, a division of Red Hat, Inc.. All Rights Reserved.