javax.security.jacc.URLPatternSpec.<init>()方法的使用及代码示例

x33g5p2x  于2022-02-01 转载在 其他  
字(7.5k)|赞(0)|评价(0)|浏览(111)

本文整理了Java中javax.security.jacc.URLPatternSpec.<init>()方法的一些代码示例,展示了URLPatternSpec.<init>()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。URLPatternSpec.<init>()方法的具体详情如下:
包路径:javax.security.jacc.URLPatternSpec
类名称:URLPatternSpec
方法名:<init>

URLPatternSpec.<init>介绍

[英]The specification contains a URLPatternSpec that identifies the web resources to which the permissions applies. The syntax of a URLPatternSpec is as follows:

URLPatternList ::= URLPattern | URLPatternList colon URLPattern  
URLPatternSpec ::= null | URLPattern | URLPattern colon URLPatternList

A null URLPatternSpec is translated to the default URLPattern, "/", by the permission constructor. The empty string is an exact URLPattern, and may occur anywhere in a URLPatternSpec that an exact URLPattern may occur. 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.
    [中]该规范包含一个URLPatternSpec,用于标识应用权限的web资源。URLPatternSpec的语法如下所示:
URLPatternList ::= URLPattern | URLPatternList colon URLPattern  
URLPatternSpec ::= null | URLPattern | URLPattern colon URLPatternList

空的URLPatternSpec由权限构造函数转换为默认的URLPattern“/”。空字符串是一个精确的URLPattern,可能出现在URLPatternSpec中任何可能出现精确URLPattern的地方。URLPatternSpec中的第一个URLPattern可以是Java Servlet规范中定义的任何模式类型(精确、路径前缀、扩展或默认)。当URLPatternSpec包含URLPatternList时,URLPatternList的模式会识别权限不适用的资源,并取决于第一个模式的模式类型和值,如下所示:
*URLPatternList中可能不存在与第一个模式匹配的模式。
*如果第一模式是路径前缀模式,则在URLPatternList中只能出现与第一模式匹配的精确模式和与第一模式匹配但不同的路径前缀模式。
*如果第一个模式是扩展模式,那么URLPatternList中只能出现与第一个模式和路径前缀模式匹配的精确模式。
*如果第一个模式是默认模式“/”,则除了默认模式之外的任何模式都可能出现在URLPatternList中。
*如果第一个模式是完全相同的模式,则URLPatternList不能出现在URLPatternSpec中。

代码示例

代码示例来源:origin: org.apache.openejb/javaee-api

public WebUserDataPermission(String urlPattern, String[] HTTPMethods, String transportType) {
  super(urlPattern);
  urlPatternSpec = new URLPatternSpec(urlPattern);
  httpMethodSpec = new HTTPMethodSpec(HTTPMethods, transportType == null? "NONE": transportType);
}

代码示例来源:origin: org.apache.geronimo.specs/geronimo-jacc_1.1_spec

public WebUserDataPermission(String name, String actions) {
  super(name);
  urlPatternSpec = new URLPatternSpec(name);
  httpMethodSpec = new HTTPMethodSpec(actions, true);
}

代码示例来源:origin: org.apache.geronimo.specs/geronimo-jacc_1.4_spec

public WebResourcePermission(String urlPattern, String[] HTTPMethods) {
  super(urlPattern);
  urlPatternSpec = new URLPatternSpec(urlPattern);
  httpMethodSpec = new HTTPMethodSpec(HTTPMethods);
}

代码示例来源:origin: org.apache.geronimo.specs/geronimo-jacc_1.4_spec

public WebUserDataPermission(String name, String actions) {
  super(name);
  urlPatternSpec = new URLPatternSpec(name);
  httpMethodSpec = new HTTPMethodSpec(actions, true);
}

代码示例来源:origin: org.apache.geronimo.specs/geronimo-jacc_1.4_spec

public WebUserDataPermission(String urlPattern, String[] HTTPMethods, String transportType) {
  super(urlPattern);
  urlPatternSpec = new URLPatternSpec(urlPattern);
  httpMethodSpec = new HTTPMethodSpec(HTTPMethods, transportType == null? "NONE": transportType);
}

代码示例来源:origin: org.apache.openejb/javaee-api

public WebUserDataPermission(String name, String actions) {
  super(name);
  urlPatternSpec = new URLPatternSpec(name);
  httpMethodSpec = new HTTPMethodSpec(actions, true);
}

代码示例来源:origin: org.apache.geronimo.specs/geronimo-jacc_1.1_spec

public WebResourcePermission(String urlPattern, String[] HTTPMethods) {
  super(urlPattern);
  urlPatternSpec = new URLPatternSpec(urlPattern);
  httpMethodSpec = new HTTPMethodSpec(HTTPMethods);
}

代码示例来源:origin: org.apache.geronimo.specs/geronimo-jacc_1.1_spec

public WebUserDataPermission(String urlPattern, String[] HTTPMethods, String transportType) {
  super(urlPattern);
  urlPatternSpec = new URLPatternSpec(urlPattern);
  httpMethodSpec = new HTTPMethodSpec(HTTPMethods, transportType == null? "NONE": transportType);
}

代码示例来源:origin: org.apache.geronimo.specs/geronimo-jacc_1.4_spec

public WebResourcePermission(String name, String actions) {
  super(name);
  urlPatternSpec = new URLPatternSpec(name);
  httpMethodSpec = new HTTPMethodSpec(actions, false);
}

代码示例来源:origin: org.apache.geronimo.specs/geronimo-jacc_1.4_spec

private synchronized void readObject(ObjectInputStream in) throws IOException {
  urlPatternSpec = new URLPatternSpec(in.readUTF());
  httpMethodSpec = new HTTPMethodSpec(in.readUTF(), false);
}

代码示例来源:origin: org.apache.openejb/javaee-api

public WebResourcePermission(String name, String actions) {
  super(name);
  urlPatternSpec = new URLPatternSpec(name);
  httpMethodSpec = new HTTPMethodSpec(actions, false);
}

代码示例来源:origin: org.apache.openejb/javaee-api

public WebResourcePermission(String urlPattern, String[] HTTPMethods) {
  super(urlPattern);
  urlPatternSpec = new URLPatternSpec(urlPattern);
  httpMethodSpec = new HTTPMethodSpec(HTTPMethods);
}

代码示例来源:origin: org.apache.openejb/javaee-api

private synchronized void readObject(ObjectInputStream in) throws IOException {
  urlPatternSpec = new URLPatternSpec(in.readUTF());
  httpMethodSpec = new HTTPMethodSpec(in.readUTF(), true);
}

代码示例来源:origin: org.apache.openejb/javaee-api

private synchronized void readObject(ObjectInputStream in) throws IOException {
  urlPatternSpec = new URLPatternSpec(in.readUTF());
  httpMethodSpec = new HTTPMethodSpec(in.readUTF(), false);
}

代码示例来源:origin: org.apache.geronimo.specs/geronimo-jacc_1.1_spec

public WebResourcePermission(String name, String actions) {
  super(name);
  urlPatternSpec = new URLPatternSpec(name);
  httpMethodSpec = new HTTPMethodSpec(actions, false);
}

代码示例来源:origin: org.apache.geronimo.specs/geronimo-jacc_1.1_spec

private synchronized void readObject(ObjectInputStream in) throws IOException {
  urlPatternSpec = new URLPatternSpec(in.readUTF());
  httpMethodSpec = new HTTPMethodSpec(in.readUTF(), false);
}

代码示例来源:origin: org.apache.geronimo.specs/geronimo-jacc_1.1_spec

public WebResourcePermission(HttpServletRequest request) {
  super(URLPatternSpec.encodeColons(request));
  urlPatternSpec = new URLPatternSpec(getName());
  httpMethodSpec = new HTTPMethodSpec(request.getMethod(), HTTPMethodSpec.NA);
}

代码示例来源:origin: org.apache.openejb/javaee-api

public WebResourcePermission(HttpServletRequest request) {
  super(URLPatternSpec.encodeColons(request));
  urlPatternSpec = new URLPatternSpec(getName());
  httpMethodSpec = new HTTPMethodSpec(request.getMethod(), HTTPMethodSpec.NA);
}

代码示例来源:origin: org.apache.geronimo.specs/geronimo-jacc_1.4_spec

public WebResourcePermission(HttpServletRequest request) {
  super(URLPatternSpec.encodeColons(request));
  urlPatternSpec = new URLPatternSpec(getName());
  httpMethodSpec = new HTTPMethodSpec(request.getMethod(), HTTPMethodSpec.NA);
}

代码示例来源:origin: javax.security.jacc/javax.security.jacc-api

/**
 * readObject reads the serialized fields from the
 * input stream and uses them to restore the permission. 
 * This method need not be implemented if establishing the 
 * values of the serialized fields (as is done by defaultReadObject) 
 * is sufficient to initialize the permission.
 */
private void readObject(java.io.ObjectInputStream s)
   throws IOException,ClassNotFoundException
{
parseActions((String) s.readFields().get("actions",null));
this.urlPatternSpec = new URLPatternSpec(super.getName());
}

相关文章