@Test public void testShouldCache() { CacheFilter cf = new CacheFilter(); Assert.assertTrue(cf.shouldCache("/blabla.jpg")); Assert.assertTrue(cf.shouldCache("/blabla.jpeg")); Assert.assertTrue(cf.shouldCache("/blabla.png")); Assert.assertTrue(cf.shouldCache("/blabla.gif")); Assert.assertTrue(cf.shouldCache("/blabla.css")); Assert.assertTrue(cf.shouldCache("/blabla.js")); Assert.assertTrue(cf.shouldCache("/blabla.html")); Assert.assertTrue(cf.shouldCache("/bla.cache.xx")); Assert.assertFalse(cf.shouldCache("/blabla.xx")); Assert.assertTrue(cf.shouldCache("/a/blabla.jpg")); Assert.assertTrue(cf.shouldCache("/a/blabla.jpeg")); Assert.assertTrue(cf.shouldCache("/a/blabla.png")); Assert.assertTrue(cf.shouldCache("/a/blabla.gif")); Assert.assertTrue(cf.shouldCache("/a/blabla.css")); Assert.assertTrue(cf.shouldCache("/a/blabla.js")); Assert.assertTrue(cf.shouldCache("/a/blabla.html")); Assert.assertTrue(cf.shouldCache("/a/bla.cache.xx")); Assert.assertFalse(cf.shouldCache("/a/blabla.xx")); Assert.assertTrue(cf.shouldCache("/blabla.JPG")); Assert.assertTrue(cf.shouldCache("/blabla.JPEG")); Assert.assertTrue(cf.shouldCache("/blabla.PnG")); Assert.assertTrue(cf.shouldCache("/blabla.GIF")); Assert.assertTrue(cf.shouldCache("/blabla.CSS")); Assert.assertTrue(cf.shouldCache("/blabla.JS")); Assert.assertTrue(cf.shouldCache("/blabla.HTML")); Assert.assertTrue(cf.shouldCache("/bla.cache.XX")); Assert.assertTrue(cf.shouldCache("/bla.CACHE.xx")); Assert.assertFalse(cf.shouldCache("/blabla.XX")); Assert.assertTrue(cf.shouldCache("/a/blabla.JPG")); Assert.assertTrue(cf.shouldCache("/a/blabla.PNG")); Assert.assertTrue(cf.shouldCache("/a/blabla.GIF")); Assert.assertTrue(cf.shouldCache("/a/blabla.CSS")); Assert.assertTrue(cf.shouldCache("/a/blabla.JS")); Assert.assertTrue(cf.shouldCache("/a/blabla.HTML")); Assert.assertTrue(cf.shouldCache("/a/bla.cache.XX")); Assert.assertTrue(cf.shouldCache("/a/bla.CACHE.xx")); Assert.assertFalse(cf.shouldCache("/a/blabla.XX")); }
public boolean shouldCache(String requestUri) { String uri = requestUri.toLowerCase(); return checkContains(uri, cacheIdentifiers) || checkSuffixes(uri, cacheSuffixes); }
CacheFilter implements Filter { public boolean shouldCache(String requestUri) { String uri = requestUri.toLowerCase(); return checkContains(uri, cacheIdentifiers) || checkSuffixes(uri, cacheSuffixes); } }
CacheFilter implements Filter { public boolean shouldCache(String requestUri) { String uri = requestUri.toLowerCase(); return checkContains(uri, cacheIdentifiers) || checkSuffixes(uri, cacheSuffixes); }  }
CacheFilter implements Filter { public boolean shouldCache(String requestUri) { String uri = requestUri.toLowerCase(); return checkContains(uri, cacheIdentifiers) || checkSuffixes(uri, cacheSuffixes); }  @Override void destroy(); @Override void init(FilterConfig config); @Override @edu.umd.cs.findbugs.annotations.SuppressWarnings(value = "AvoidUsingHardCodedIP", justification = "double-safe check on localhost, ease configuration for development") void doFilter(ServletRequest request, ServletResponse response, FilterChain filterChain); boolean shouldCache(String requestUri); boolean shouldNotCache(String requestUri); boolean shouldCompress(String requestUri); boolean checkContains(String uri, String[] patterns); boolean checkSuffixes(String uri, String[] patterns); boolean checkPrefixes(String uri, String[] patterns); @Api static void configureNoCaching(HttpServletResponse response); }
CacheFilter implements Filter { public boolean shouldCache(String requestUri) { String uri = requestUri.toLowerCase(); return checkContains(uri, cacheIdentifiers) || checkSuffixes(uri, cacheSuffixes); }  @Override void destroy(); @Override void init(FilterConfig config); @Override @edu.umd.cs.findbugs.annotations.SuppressWarnings(value = "AvoidUsingHardCodedIP", justification = "double-safe check on localhost, ease configuration for development") void doFilter(ServletRequest request, ServletResponse response, FilterChain filterChain); boolean shouldCache(String requestUri); boolean shouldNotCache(String requestUri); boolean shouldCompress(String requestUri); boolean checkContains(String uri, String[] patterns); boolean checkSuffixes(String uri, String[] patterns); boolean checkPrefixes(String uri, String[] patterns); @Api static void configureNoCaching(HttpServletResponse response); static final String CACHE_DURATION_IN_SECONDS; static final String CACHE_IDENTIFIERS; static final String CACHE_SUFFIXES; static final String NO_CACHE_IDENTIFIERS; static final String NO_CACHE_SUFFIXES; static final String ZIP_SUFFIXES; static final String SKIP_PREFIXES; static final String PARAMETER_SPLIT_REGEX; static final String LOCALHOST_NAME; static final String LOCALHOST_IP_V4; static final String LOCALHOST_IP_V6; }