static HttpMethodSpec getSpec (String actions) { HttpMethodSpec rvalue; if (actions == null || actions.equals(emptyString)) { rvalue = allSpec; } else { BitSet set = new BitSet(); rvalue = getStandardSpec(actions,set); if (!set.isEmpty()) { rvalue = new HttpMethodSpec(rvalue,set); } } return rvalue; }
String getActions() { if (standardMap == 0 && extensionSet == null) { return null; } synchronized(this) { if (actions != null) { return actions; } if (standardSpec != null) { actions = getExtensionActions(standardSpec.getActions(),standardMap, extensionSet); } else { actions = getStandardActions(exceptionList,standardMap); } } return actions; }
private void parseActions(String actions) { this.transportType = TT_NONE; if (actions == null || actions.equals("")) { this.methodSpec = HttpMethodSpec.getSpec((String) null); } else { int colon = actions.indexOf(':'); if (colon < 0) { this.methodSpec = HttpMethodSpec.getSpec(actions); } else { if (colon == 0) { this.methodSpec = HttpMethodSpec.getSpec((String) null); } else { this.methodSpec = HttpMethodSpec.getSpec (actions.substring(0,colon)); } Integer bit = (Integer) transportHash.get(actions.substring(colon+1)); if (bit == null) throw new IllegalArgumentException ("illegal transport value"); this.transportType = bit.intValue(); } } }
static HttpMethodSpec getSpec (String[] methods) { HttpMethodSpec rvalue; if (methods == null || methods.length == 0) { rvalue = allSpec; } else { int map = 0; BitSet set = new BitSet(); for (int i=0; i<methods.length; i++) { Integer bit = (Integer) methodHash.get(methods[i]); if (bit != null) { map |= bit.intValue(); } else { setExtensionBit(methods[i],set); } } if (set.isEmpty()) { rvalue = specArray[map]; } else { rvalue = new HttpMethodSpec(specArray[map],set); } } return rvalue; }
/** * Returns a canonical String representation of the actions of this * WebResourcePermission. In the canonical form, predefined methods * preceed extension methods, and within each method classification the * corresponding methods occur in ascending lexical order. There may be * no duplicate HTTP methods in the canonical form, and the canonical * form of the set of all HTTP methods is the value null. * <P> * @return a String containing the canonicalized actions of this * WebResourcePermission (or the null value). */ public String getActions() { return this.methodSpec.getActions(); }
/** * Checks two WebResourcePermission objects for equality. * WebResourcePermission objects are equivalent if their * URLPatternSpec and (canonicalized) actions values are equivalent. * The URLPatternSpec of a reference permission is equivalent to that * of an argument permission if their first patterns are * equivalent, and the patterns of the URLPatternList of the reference * permission collectively match exactly the same set of patterns * as are matched by the patterns of the URLPatternList of the * argument permission. * <P> * Two Permission objects, P1 and P2, are equivalent if and only if * P1.implies(P2) && P2.implies(P1). * <P> * @param o the WebResourcePermission object being tested for equality * with this WebResourcePermission. * <P> * @return true if the argument WebResourcePermission object is equivalent * to this WebResourcePermission. */ public boolean equals(Object o) { if (o == null || ! (o instanceof WebResourcePermission)) return false; WebResourcePermission that = (WebResourcePermission) o; if (!this.methodSpec.equals(that.methodSpec)) return false; return this.urlPatternSpec.equals(that.urlPatternSpec); }
if (!this.methodSpec.implies(that.methodSpec)) return false;
private String getExtensionActions(String standardActions, int map, BitSet set) { ArrayList methods = null; for(int i=set.nextSetBit(0); i>=0; i=set.nextSetBit(i+1)) { if (methods == null) { methods = new ArrayList(); } methods.add(getExtensionMethod(i)); } String rvalue; if (methods == null) { rvalue = standardActions; } else { Collections.sort(methods); StringBuffer actBuf = new StringBuffer (standardActions == null ? (exceptionList ? exclaimationPoint : emptyString) : standardActions); for (int i = 0; i < methods.size(); i++) { if (i > 0 || map > 0) { actBuf.append(comma); } actBuf.append(methods.get(i)); } rvalue = actBuf.toString(); } return rvalue; }
static HttpMethodSpec getSpec (String[] methods) { HttpMethodSpec rvalue; if (methods == null || methods.length == 0) { rvalue = allSpec; } else { int map = 0; BitSet set = new BitSet(); for (int i=0; i<methods.length; i++) { Integer bit = (Integer) methodHash.get(methods[i]); if (bit != null) { map |= bit.intValue(); } else { setExtensionBit(methods[i],set); } } if (set.isEmpty()) { rvalue = specArray[map]; } else { rvalue = new HttpMethodSpec(specArray[map],set); } } return rvalue; }
public String toString() { return getActions(); }
/** * Checks two WebUserDataPermission objects for equality. * WebUserDataPermission objects are equivalent if their * URLPatternSpec and (canonicalized) actions values are equivalent. * The URLPatternSpec of a reference permission is equivalent to that * of an argument permission if their first patterns are * equivalent, and the patterns of the URLPatternList of the reference * permission collectively match exactly the same set of patterns * as are matched by the patterns of the URLPatternList of the * argument permission. * <P> * Two Permission objects, P1 and P2, are equivalent if and only if * P1.implies(P2) && P2.implies(P1). * <P> * @param o the WebUserDataPermission object being tested for equality * with this WebUserDataPermission. * <P> * @return true if the argument WebUserDataPermission object is equivalent * to this WebUserDataPermission. */ public boolean equals(Object o) { if (o == null || ! (o instanceof WebUserDataPermission)) return false; WebUserDataPermission that = (WebUserDataPermission) o; if (this.transportType != that.transportType) return false; if (!this.methodSpec.equals(that.methodSpec)) return false; return this.urlPatternSpec.equals(that.urlPatternSpec); }
this.transportType != that.transportType) return false; if (!this.methodSpec.implies(that.methodSpec)) return false;
private String getExtensionActions(String standardActions, int map, BitSet set) { ArrayList methods = null; for(int i=set.nextSetBit(0); i>=0; i=set.nextSetBit(i+1)) { if (methods == null) { methods = new ArrayList(); } methods.add(getExtensionMethod(i)); } String rvalue; if (methods == null) { rvalue = standardActions; } else { Collections.sort(methods); StringBuffer actBuf = new StringBuffer (standardActions == null ? (exceptionList ? exclaimationPoint : emptyString) : standardActions); for (int i = 0; i < methods.size(); i++) { if (i > 0 || map > 0) { actBuf.append(comma); } actBuf.append(methods.get(i)); } rvalue = actBuf.toString(); } return rvalue; }
String getActions() { if (standardMap == 0 && extensionSet == null) { return null; } synchronized(this) { if (actions != null) { return actions; } if (standardSpec != null) { actions = getExtensionActions(standardSpec.getActions(),standardMap, extensionSet); } else { actions = getStandardActions(exceptionList,standardMap); } } return actions; }
private void parseActions(String actions) { this.transportType = TT_NONE; if (actions == null || actions.equals("")) { this.methodSpec = HttpMethodSpec.getSpec((String) null); } else { int colon = actions.indexOf(':'); if (colon < 0) { this.methodSpec = HttpMethodSpec.getSpec(actions); } else { if (colon == 0) { this.methodSpec = HttpMethodSpec.getSpec((String) null); } else { this.methodSpec = HttpMethodSpec.getSpec (actions.substring(0,colon)); } Integer bit = (Integer) transportHash.get(actions.substring(colon+1)); if (bit == null) throw new IllegalArgumentException ("illegal transport value"); this.transportType = bit.intValue(); } } }
static HttpMethodSpec getSpec (String actions) { HttpMethodSpec rvalue; if (actions == null || actions.equals(emptyString)) { rvalue = allSpec; } else { BitSet set = new BitSet(); rvalue = getStandardSpec(actions,set); if (!set.isEmpty()) { rvalue = new HttpMethodSpec(rvalue,set); } } return rvalue; }
/** * Returns the hash code value for this WebResourcePermission. The * properties of the returned hash code must be as follows: <p> * <ul> * <li> During the lifetime of a Java application, the hashCode method * must return the same integer value, every time it is called on a * WebResourcePermission object. The value returned by hashCode for a * particular WebResourcePermission need not remain consistent from * one execution of an application to another. * <li> If two WebResourcePermission objects are equal according to the * equals method, then calling the hashCode method on each of the two * Permission objects must produce the same integer result (within an * application). * </ul> * <P> * @return the integer hash code value for this object. */ public int hashCode() { if (this.hashCodeValue == 0) { String hashInput = this.urlPatternSpec.toString()+ " " + this.methodSpec.hashCode(); this.hashCodeValue = hashInput.hashCode(); } return this.hashCodeValue; }
/** * Returns a canonical String representation of the actions of this * WebResourcePermission. In the canonical form, predefined methods * preceed extension methods, and within each method classification the * corresponding methods occur in ascending lexical order. There may be * no duplicate HTTP methods in the canonical form, and the canonical * form of the set of all HTTP methods is the value null. * <P> * @return a String containing the canonicalized actions of this * WebResourcePermission (or the null value). */ public String getActions() { return this.methodSpec.getActions(); }