@Override public boolean matchesUri(String uri) { return patternMatcher.matches(uri); } }
private boolean shouldFilter(String uri) { return uri != null && patternMatcher.matches(uri); }
boolean shouldServe(String uri) { return uri != null && patternMatcher.matches(uri); }
public void testMatches_regex() { UriPatternMatcher pattern = UriPatternType.get(UriPatternType.REGEX, "/.*/foo"); assertFalse(pattern.matches("/foo/asdf")); assertFalse(pattern.matches("/foo/asdf?val=1")); assertTrue(pattern.matches("/path/foo")); assertTrue(pattern.matches("/path/foo?val=1")); assertFalse(pattern.matches("/foo")); assertFalse(pattern.matches("/foo?val=1")); }
public void testMatches_servlet() { UriPatternMatcher pattern = UriPatternType.get(UriPatternType.SERVLET, "/foo/*"); assertTrue(pattern.matches("/foo/asdf")); assertTrue(pattern.matches("/foo/asdf?val=1")); assertFalse(pattern.matches("/path/file.bar")); assertFalse(pattern.matches("/path/file.bar?val=1")); assertFalse(pattern.matches("/asdf")); assertFalse(pattern.matches("/asdf?val=1")); pattern = UriPatternType.get(UriPatternType.SERVLET, "*.bar"); assertFalse(pattern.matches("/foo/asdf")); assertFalse(pattern.matches("/foo/asdf?val=1")); assertTrue(pattern.matches("/path/file.bar")); assertTrue(pattern.matches("/path/file.bar?val=1")); assertFalse(pattern.matches("/asdf")); assertFalse(pattern.matches("/asdf?val=1")); pattern = UriPatternType.get(UriPatternType.SERVLET, "/asdf"); assertFalse(pattern.matches("/foo/asdf")); assertFalse(pattern.matches("/foo/asdf?val=1")); assertFalse(pattern.matches("/path/file.bar")); assertFalse(pattern.matches("/path/file.bar?val=1")); assertTrue(pattern.matches("/asdf")); assertTrue(pattern.matches("/asdf?val=1")); }
@Override public boolean matchesUri(String uri) { return patternMatcher.matches(uri); } }
@Override public boolean matchesUri(String uri) { return patternMatcher.matches(uri); } }
public boolean matchesUri(String uri) { return patternMatcher.matches(uri); }
boolean shouldServe(String uri) { return uri != null && patternMatcher.matches(uri); }
private boolean shouldFilter(String uri) { return patternMatcher.matches(uri); }
boolean shouldServe(String uri) { return patternMatcher.matches(uri); }
boolean shouldServe(String uri) { return uri != null && patternMatcher.matches(uri); }
private boolean shouldFilter(String uri) { return patternMatcher.matches(uri); }
boolean shouldServe(String uri) { return patternMatcher.matches(uri); }
private boolean shouldFilter(String uri) { return uri != null && patternMatcher.matches(uri); }
private boolean shouldFilter(String uri) { return uri != null && patternMatcher.matches(uri); }
boolean shouldServe(String uri) { return patternMatcher.matches(uri); }
private boolean shouldFilter(String uri) { return patternMatcher.matches(uri); }
public boolean matchesUri(String uri) { return patternMatcher.matches(uri); }