public synchronized PathMatcher addExactPath(final String path, final T handler) { if (path.isEmpty()) { throw UndertowMessages.MESSAGES.pathMustBeSpecified(); } exactPathMatches.put(URLUtils.normalizeSlashes(path), handler); return this; }
public synchronized PathMatcher removeExactPath(final String path) { if (path == null || path.isEmpty()) { throw UndertowMessages.MESSAGES.pathMustBeSpecified(); } exactPathMatches.remove(URLUtils.normalizeSlashes(path)); return this; }
public T getPrefixPath(final String path) { final String normalizedPath = URLUtils.normalizeSlashes(path); // enable the prefix path mechanism to return the default handler SubstringMap.SubstringMatch<T> match = paths.get(normalizedPath); if (PathMatcher.STRING_PATH_SEPARATOR.equals(normalizedPath) && match == null) { return this.defaultHandler; } if (match == null) { return null; } // return the value for the given path return match.getValue(); }
public synchronized PathMatcher removePrefixPath(final String path) { if (path == null || path.isEmpty()) { throw UndertowMessages.MESSAGES.pathMustBeSpecified(); } final String normalizedPath = URLUtils.normalizeSlashes(path); if (PathMatcher.STRING_PATH_SEPARATOR.equals(normalizedPath)) { defaultHandler = null; return this; } paths.remove(normalizedPath); buildLengths(); return this; }
public T getExactPath(final String path) { return exactPathMatches.get(URLUtils.normalizeSlashes(path)); }