/** * Return <code>true</code> if the specified context-relative URI (and * associated HTTP method) are protected by this security constraint. * * @param uri Context-relative URI to check * @param method Request method being used */ public boolean included(String uri, String method) { // We cannot match without a valid request method if (method == null) return (false); // Check all of the collections included in this constraint for (int i = 0; i < collections.length; i++) { if (!collections[i].findMethod(method)) continue; String patterns[] = collections[i].findPatterns(); for (int j = 0; j < patterns.length; j++) { if (matchPattern(uri, patterns[j])) return (true); } } // No collection included in this constraint matches this request return (false); }
/** * Check if the constraint applies to a URI and method. * @param uri Context-relative URI to check * @param method Request method being used * @return <code>true</code> if the specified context-relative URI (and * associated HTTP method) are protected by this security constraint. */ public boolean included(String uri, String method) { // We cannot match without a valid request method if (method == null) return false; // Check all of the collections included in this constraint for (int i = 0; i < collections.length; i++) { if (!collections[i].findMethod(method)) continue; String patterns[] = collections[i].findPatterns(); for (int j = 0; j < patterns.length; j++) { if (matchPattern(uri, patterns[j])) return true; } } // No collection included in this constraint matches this request return false; }
/** * Check if the constraint applies to a URI and method. * @param uri Context-relative URI to check * @param method Request method being used * @return <code>true</code> if the specified context-relative URI (and * associated HTTP method) are protected by this security constraint. */ public boolean included(String uri, String method) { // We cannot match without a valid request method if (method == null) return false; // Check all of the collections included in this constraint for (int i = 0; i < collections.length; i++) { if (!collections[i].findMethod(method)) continue; String patterns[] = collections[i].findPatterns(); for (int j = 0; j < patterns.length; j++) { if (matchPattern(uri, patterns[j])) return true; } } // No collection included in this constraint matches this request return false; }