/** * @deprecated use {@link UriPatternMatcher} directly */ @Deprecated protected boolean matchUriRequestPattern(final String pattern, final String requestUri) { return matcher.matchUriRequestPattern(pattern, requestUri); }
public Object lookup(String requestURI) { if (requestURI == null) { throw new IllegalArgumentException("Request URI may not be null"); } //Strip away the query part part if found int index = requestURI.indexOf("?"); if (index != -1) { requestURI = requestURI.substring(0, index); } // direct match? Object handler = this.handlerMap.get(requestURI); if (handler == null) { // pattern match? String bestMatch = null; for (Iterator it = this.handlerMap.keySet().iterator(); it.hasNext();) { String pattern = (String) it.next(); if (matchUriRequestPattern(pattern, requestURI)) { // we have a match. is it any better? if (bestMatch == null || (bestMatch.length() < pattern.length()) || (bestMatch.length() == pattern.length() && pattern.endsWith("*"))) { handler = this.handlerMap.get(pattern); bestMatch = pattern; } } } } return handler; }
/** * @deprecated use {@link UriPatternMatcher} directly */ @Deprecated protected boolean matchUriRequestPattern(final String pattern, final String requestUri) { return matcher.matchUriRequestPattern(pattern, requestUri); }
/** * @deprecated use {@link UriPatternMatcher} directly */ @Deprecated protected boolean matchUriRequestPattern(final String pattern, final String requestUri) { return matcher.matchUriRequestPattern(pattern, requestUri); }
/** * @deprecated use {@link UriPatternMatcher} directly */ @Deprecated protected boolean matchUriRequestPattern(final String pattern, final String requestUri) { return matcher.matchUriRequestPattern(pattern, requestUri); }
/** * @deprecated use {@link UriPatternMatcher} directly */ @Deprecated protected boolean matchUriRequestPattern(final String pattern, final String requestUri) { return matcher.matchUriRequestPattern(pattern, requestUri); }
public Object lookup(String requestURI) { if (requestURI == null) { throw new IllegalArgumentException("Request URI may not be null"); } //Strip away the query part part if found int index = requestURI.indexOf("?"); if (index != -1) { requestURI = requestURI.substring(0, index); } // direct match? Object handler = this.handlerMap.get(requestURI); if (handler == null) { // pattern match? String bestMatch = null; for (Iterator it = this.handlerMap.keySet().iterator(); it.hasNext();) { String pattern = (String) it.next(); if (matchUriRequestPattern(pattern, requestURI)) { // we have a match. is it any better? if (bestMatch == null || (bestMatch.length() < pattern.length()) || (bestMatch.length() == pattern.length() && pattern.endsWith("*"))) { handler = this.handlerMap.get(pattern); bestMatch = pattern; } } } } return handler; }
public Object lookup(String requestURI) { if (requestURI == null) { throw new IllegalArgumentException("Request URI may not be null"); } //Strip away the query part part if found int index = requestURI.indexOf("?"); if (index != -1) { requestURI = requestURI.substring(0, index); } // direct match? Object handler = this.handlerMap.get(requestURI); if (handler == null) { // pattern match? String bestMatch = null; for (Iterator it = this.handlerMap.keySet().iterator(); it.hasNext();) { String pattern = (String) it.next(); if (matchUriRequestPattern(pattern, requestURI)) { // we have a match. is it any better? if (bestMatch == null || (bestMatch.length() < pattern.length()) || (bestMatch.length() == pattern.length() && pattern.endsWith("*"))) { handler = this.handlerMap.get(pattern); bestMatch = pattern; } } } } return handler; }
/** * Looks up an object matching the given request path. * * @param path the request path * @return object or {@code null} if no match is found. */ public synchronized T lookup(final String path) { Args.notNull(path, "Request path"); // direct match? T obj = this.map.get(path); if (obj == null) { // pattern match? String bestMatch = null; for (final String pattern : this.map.keySet()) { if (matchUriRequestPattern(pattern, path)) { // we have a match. is it any better? if (bestMatch == null || (bestMatch.length() < pattern.length()) || (bestMatch.length() == pattern.length() && pattern.endsWith("*"))) { obj = this.map.get(pattern); bestMatch = pattern; } } } } return obj; }
/** * Looks up an object matching the given request path. * * @param path the request path * @return object or {@code null} if no match is found. */ public synchronized T lookup(final String path) { Args.notNull(path, "Request path"); // direct match? T obj = this.map.get(path); if (obj == null) { // pattern match? String bestMatch = null; for (final String pattern : this.map.keySet()) { if (matchUriRequestPattern(pattern, path)) { // we have a match. is it any better? if (bestMatch == null || (bestMatch.length() < pattern.length()) || (bestMatch.length() == pattern.length() && pattern.endsWith("*"))) { obj = this.map.get(pattern); bestMatch = pattern; } } } } return obj; }
/** * Looks up an object matching the given request path. * * @param path the request path * @return object or <code>null</code> if no match is found. */ public synchronized T lookup(final String path) { Args.notNull(path, "Request path"); // direct match? T obj = this.map.get(path); if (obj == null) { // pattern match? String bestMatch = null; for (final String pattern : this.map.keySet()) { if (matchUriRequestPattern(pattern, path)) { // we have a match. is it any better? if (bestMatch == null || (bestMatch.length() < pattern.length()) || (bestMatch.length() == pattern.length() && pattern.endsWith("*"))) { obj = this.map.get(pattern); bestMatch = pattern; } } } } return obj; }
public Object lookup(String requestURI) { if (requestURI == null) { throw new IllegalArgumentException("Request URI may not be null"); } //Strip away the query part part if found int index = requestURI.indexOf("?"); if (index != -1) { requestURI = requestURI.substring(0, index); } // direct match? Object handler = this.handlerMap.get(requestURI); if (handler == null) { // pattern match? String bestMatch = null; for (Iterator it = this.handlerMap.keySet().iterator(); it.hasNext();) { String pattern = (String) it.next(); if (matchUriRequestPattern(pattern, requestURI)) { // we have a match. is it any better? if (bestMatch == null || (bestMatch.length() < pattern.length()) || (bestMatch.length() == pattern.length() && pattern.endsWith("*"))) { handler = this.handlerMap.get(pattern); bestMatch = pattern; } } } } return handler; }
public Object lookup(String requestURI) { if (requestURI == null) { throw new IllegalArgumentException("Request URI may not be null"); } //Strip away the query part part if found int index = requestURI.indexOf("?"); if (index != -1) { requestURI = requestURI.substring(0, index); } // direct match? Object handler = this.handlerMap.get(requestURI); if (handler == null) { // pattern match? String bestMatch = null; for (Iterator it = this.handlerMap.keySet().iterator(); it.hasNext();) { String pattern = (String) it.next(); if (matchUriRequestPattern(pattern, requestURI)) { // we have a match. is it any better? if (bestMatch == null || (bestMatch.length() < pattern.length()) || (bestMatch.length() == pattern.length() && pattern.endsWith("*"))) { handler = this.handlerMap.get(pattern); bestMatch = pattern; } } } } return handler; }
/** * Looks up an object matching the given request path. * * @param path the request path * @return object or {@code null} if no match is found. */ public synchronized T lookup(final String path) { Args.notNull(path, "Request path"); // direct match? T obj = this.map.get(path); if (obj == null) { // pattern match? String bestMatch = null; for (final String pattern : this.map.keySet()) { if (matchUriRequestPattern(pattern, path)) { // we have a match. is it any better? if (bestMatch == null || (bestMatch.length() < pattern.length()) || (bestMatch.length() == pattern.length() && pattern.endsWith("*"))) { obj = this.map.get(pattern); bestMatch = pattern; } } } } return obj; }
/** * Looks up an object matching the given request path. * * @param path the request path * @return object or {@code null} if no match is found. */ public synchronized T lookup(final String path) { Args.notNull(path, "Request path"); // direct match? T obj = this.map.get(path); if (obj == null) { // pattern match? String bestMatch = null; for (final String pattern : this.map.keySet()) { if (matchUriRequestPattern(pattern, path)) { // we have a match. is it any better? if (bestMatch == null || (bestMatch.length() < pattern.length()) || (bestMatch.length() == pattern.length() && pattern.endsWith("*"))) { obj = this.map.get(pattern); bestMatch = pattern; } } } } return obj; }