本文整理汇总了Java中org.apache.catalina.deploy.SecurityConstraint.findCollections方法的典型用法代码示例。如果您正苦于以下问题:Java SecurityConstraint.findCollections方法的具体用法?Java SecurityConstraint.findCollections怎么用?Java SecurityConstraint.findCollections使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.apache.catalina.deploy.SecurityConstraint
的用法示例。
在下文中一共展示了SecurityConstraint.findCollections方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: addConstraint
import org.apache.catalina.deploy.SecurityConstraint; //导入方法依赖的package包/类
/**
* Add a security constraint to the set for this web application.
*/
@Override
public void addConstraint(SecurityConstraint constraint) {
// Validate the proposed constraint
SecurityCollection collections[] = constraint.findCollections();
for (int i = 0; i < collections.length; i++) {
String patterns[] = collections[i].findPatterns();
for (int j = 0; j < patterns.length; j++) {
patterns[j] = adjustURLPattern(patterns[j]);
if (!validateURLPattern(patterns[j]))
throw new IllegalArgumentException
(sm.getString
("standardContext.securityConstraint.pattern",
patterns[j]));
}
if (collections[i].findMethods().length > 0 &&
collections[i].findOmittedMethods().length > 0) {
throw new IllegalArgumentException(sm.getString(
"standardContext.securityConstraint.mixHttpMethod"));
}
}
// Add this constraint to the set for our web application
synchronized (constraintsLock) {
SecurityConstraint results[] =
new SecurityConstraint[constraints.length + 1];
for (int i = 0; i < constraints.length; i++)
results[i] = constraints[i];
results[constraints.length] = constraint;
constraints = results;
}
}
示例2: addConstraint
import org.apache.catalina.deploy.SecurityConstraint; //导入方法依赖的package包/类
/**
* Add a security constraint to the set for this web application.
*/
public void addConstraint(SecurityConstraint constraint) {
// Validate the proposed constraint
SecurityCollection collections[] = constraint.findCollections();
for (int i = 0; i < collections.length; i++) {
String patterns[] = collections[i].findPatterns();
for (int j = 0; j < patterns.length; j++) {
patterns[j] = adjustURLPattern(patterns[j]);
if (!validateURLPattern(patterns[j]))
throw new IllegalArgumentException
(sm.getString
("standardContext.securityConstraint.pattern",
patterns[j]));
}
}
// Add this constraint to the set for our web application
synchronized (constraints) {
SecurityConstraint results[] =
new SecurityConstraint[constraints.length + 1];
for (int i = 0; i < constraints.length; i++)
results[i] = constraints[i];
results[constraints.length] = constraint;
constraints = results;
}
}
示例3: addConstraint
import org.apache.catalina.deploy.SecurityConstraint; //导入方法依赖的package包/类
/**
* Add a security constraint to the set for this web application.
*/
@Override
public void addConstraint(SecurityConstraint constraint) {
// Validate the proposed constraint
SecurityCollection collections[] = constraint.findCollections();
for (int i = 0; i < collections.length; i++) {
String patterns[] = collections[i].findPatterns();
for (int j = 0; j < patterns.length; j++) {
patterns[j] = adjustURLPattern(patterns[j]);
if (!validateURLPattern(patterns[j]))
throw new IllegalArgumentException(
sm.getString("standardContext.securityConstraint.pattern", patterns[j]));
}
if (collections[i].findMethods().length > 0 && collections[i].findOmittedMethods().length > 0) {
throw new IllegalArgumentException(sm.getString("standardContext.securityConstraint.mixHttpMethod"));
}
}
// Add this constraint to the set for our web application
synchronized (constraintsLock) {
SecurityConstraint results[] = new SecurityConstraint[constraints.length + 1];
for (int i = 0; i < constraints.length; i++)
results[i] = constraints[i];
results[constraints.length] = constraint;
constraints = results;
}
}