in geronimo-jacc_1.1_spec/src/main/java/javax/security/jacc/HTTPMethodSpec.java [58:124]
public HTTPMethodSpec(String name, boolean parseTransportType) {
if (parseTransportType) {
if (name == null || name.length() == 0) {
this.transport = NONE;
} else {
String[] tokens = name.split(":", 2);
if (tokens.length == 2) {
if (tokens[1].equals("NONE")) {
this.transport = NONE;
} else if (tokens[1].equals("INTEGRAL")) {
this.transport = INTEGRAL;
} else if (tokens[1].equals("CONFIDENTIAL")) {
this.transport = CONFIDENTIAL;
} else {
throw new IllegalArgumentException("Invalid transportType: " + tokens[1]);
}
} else {
this.transport = NONE;
}
name = tokens[0];
}
} else {
this.transport = NA;
}
if (name == null || name.length() == 0) {
this.mask = 0x00;
this.extensionMethods = NO_METHODS;
this.isExcluded = true;
} else {
ArrayList<String> extensions = null;
if (isExcluded = name.charAt(0) == '!') {
name = name.substring(1);
}
int tmpMask = 0;
if (name.length() > 0) {
String[] methods = name.split(",", -1);
for (int i = 0; i < methods.length; i++) {
boolean found = false;
for (int j = 0; j < HTTP_METHODS.length; j++) {
if (methods[i].equals(HTTP_METHODS[j])) {
tmpMask |= HTTP_MASKS[j];
found = true;
break;
}
}
if (!found) {
checkToken(methods[i]);
if (extensions == null) {
extensions = new ArrayList<String>(methods.length);
}
add(extensions, methods[i]);
}
}
}
this.mask = tmpMask;
if (extensions == null) {
extensionMethods = NO_METHODS;
} else {
extensionMethods = extensions.toArray(new String[extensions.size()]);
}
}
}