@Override public boolean matchesUri(String uri) { return patternMatcher.matches(uri); } }
private String computePath() { if (!isPathComputed()) { String servletPath = super.getServletPath(); path = patternMatcher.extractPath(servletPath); pathComputed = true; if (null == path) { path = servletPath; } } return path; } };
@Override public UriPatternType getUriPatternType() { return patternMatcher.getPatternType(); }
@Override public String getPattern() { return patternMatcher.getOriginalPattern(); }
@Override public String getPattern() { return patternMatcher.getOriginalPattern(); }
private boolean shouldFilter(String uri) { return uri != null && patternMatcher.matches(uri); }
private String computePath() { if (!pathComputed) { String servletPath = super.getServletPath(); path = patternMatcher.extractPath(servletPath); pathComputed = true; if (null == path) { path = servletPath; } } return path; } };
@Override public UriPatternType getUriPatternType() { return patternMatcher.getPatternType(); }
@Override public String getPattern() { return patternMatcher.getOriginalPattern(); }
boolean shouldServe(String uri) { return uri != null && patternMatcher.matches(uri); }
private String computePath() { if (!isPathComputed()) { String servletPath = super.getServletPath(); path = patternMatcher.extractPath(servletPath); pathComputed = true; if (null == path) { path = servletPath; } } return path; } };
@Override public UriPatternType getUriPatternType() { return patternMatcher.getPatternType(); }
public String toPaddedString(int padding) { HttpServlet reference = httpServlet.get(); return Strings.padEnd(patternMatcher.getOriginalPattern(), padding, ' ') + ' ' + (reference != null ? reference : servletKey); } }
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")); }
private String computePath() { if (!isPathComputed()) { String servletPath = super.getServletPath(); path = patternMatcher.extractPath(servletPath); pathComputed = true; if (null == path) { path = servletPath; } } return path; } };
public UriPatternType getUriPatternType() { return patternMatcher.getPatternType(); }
public String toPaddedString(int padding) { Filter reference = filter.get(); return Strings.padEnd(patternMatcher.getOriginalPattern(), padding, ' ') + ' ' + (reference != null ? reference : filterKey); } }
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")); }
private String computePath() { if (!isPathComputed()) { String servletPath = super.getServletPath(); path = patternMatcher.extractPath(servletPath); pathComputed = true; if (null == path) { path = servletPath; } } return path; } };
public UriPatternType getUriPatternType() { return patternMatcher.getPatternType(); }