test_class.file: common-servlet/src/test/java/org/geomajas/servlet/CacheFilterTest.java
test_class.identifier: CacheFilterTest
test_case.body: @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"));
  	}
test_case.class_method_signature: CacheFilterTest.testShouldCache()
test_case.full_signature: @Test public void testShouldCache()
test_case.identifier: testShouldCache
test_case.invocations: assertTrue shouldCache assertTrue shouldCache assertTrue shouldCache assertTrue shouldCache assertTrue shouldCache assertTrue shouldCache assertTrue shouldCache assertTrue shouldCache assertFalse shouldCache assertTrue shouldCache assertTrue shouldCache assertTrue shouldCache assertTrue shouldCache assertTrue shouldCache assertTrue shouldCache assertTrue shouldCache assertTrue shouldCache assertFalse shouldCache assertTrue shouldCache assertTrue shouldCache assertTrue shouldCache assertTrue shouldCache assertTrue shouldCache assertTrue shouldCache assertTrue shouldCache assertTrue shouldCache assertTrue shouldCache assertFalse shouldCache assertTrue shouldCache assertTrue shouldCache assertTrue shouldCache assertTrue shouldCache assertTrue shouldCache assertTrue shouldCache assertTrue shouldCache assertTrue shouldCache assertFalse shouldCache
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testShouldCache()
focal_class.declarator: CACHE_DURATION_IN_SECONDS = "cacheDurationInSeconds"
focal_class.modifier: public static final
focal_class.original_string: public static final String CACHE_DURATION_IN_SECONDS = "cacheDurationInSeconds";
focal_class.type: String
focal_class.var_name: CACHE_DURATION_IN_SECONDS
focal_class.declarator: CACHE_IDENTIFIERS = "cacheIdentifiers"
focal_class.modifier: public static final
focal_class.original_string: public static final String CACHE_IDENTIFIERS = "cacheIdentifiers";
focal_class.type: String
focal_class.var_name: CACHE_IDENTIFIERS
focal_class.declarator: CACHE_SUFFIXES = "cacheSuffixes"
focal_class.modifier: public static final
focal_class.original_string: public static final String CACHE_SUFFIXES = "cacheSuffixes";
focal_class.type: String
focal_class.var_name: CACHE_SUFFIXES
focal_class.declarator: NO_CACHE_IDENTIFIERS = "noCacheIdentifiers"
focal_class.modifier: public static final
focal_class.original_string: public static final String NO_CACHE_IDENTIFIERS = "noCacheIdentifiers";
focal_class.type: String
focal_class.var_name: NO_CACHE_IDENTIFIERS
focal_class.declarator: NO_CACHE_SUFFIXES = "noCacheSuffixes"
focal_class.modifier: public static final
focal_class.original_string: public static final String NO_CACHE_SUFFIXES = "noCacheSuffixes";
focal_class.type: String
focal_class.var_name: NO_CACHE_SUFFIXES
focal_class.declarator: ZIP_SUFFIXES = "zipSuffixes"
focal_class.modifier: public static final
focal_class.original_string: public static final String ZIP_SUFFIXES = "zipSuffixes";
focal_class.type: String
focal_class.var_name: ZIP_SUFFIXES
focal_class.declarator: SKIP_PREFIXES = "skipPrefixes"
focal_class.modifier: public static final
focal_class.original_string: public static final String SKIP_PREFIXES = "skipPrefixes";
focal_class.type: String
focal_class.var_name: SKIP_PREFIXES
focal_class.declarator: PARAMETER_SPLIT_REGEX = "[\\s,]+"
focal_class.modifier: public static final
focal_class.original_string: public static final String PARAMETER_SPLIT_REGEX = "[\\s,]+";
focal_class.type: String
focal_class.var_name: PARAMETER_SPLIT_REGEX
focal_class.declarator: LOCALHOST_NAME = "localhost"
focal_class.modifier: public static final
focal_class.original_string: public static final String LOCALHOST_NAME = "localhost";
focal_class.type: String
focal_class.var_name: LOCALHOST_NAME
focal_class.declarator: LOCALHOST_IP_V4 = "127.0.0.1"
focal_class.modifier: public static final
focal_class.original_string: public static final String LOCALHOST_IP_V4 = "127.0.0.1";
focal_class.type: String
focal_class.var_name: LOCALHOST_IP_V4
focal_class.declarator: LOCALHOST_IP_V6 = "::1"
focal_class.modifier: public static final
focal_class.original_string: public static final String LOCALHOST_IP_V6 = "::1";
focal_class.type: String
focal_class.var_name: LOCALHOST_IP_V6
focal_class.declarator: MS_IN_S = 1000
focal_class.modifier: private static final
focal_class.original_string: private static final long MS_IN_S = 1000;
focal_class.type: long
focal_class.var_name: MS_IN_S
focal_class.declarator: S_IN_M = 60
focal_class.modifier: private static final
focal_class.original_string: private static final long S_IN_M = 60;
focal_class.type: long
focal_class.var_name: S_IN_M
focal_class.declarator: M_IN_H = 60
focal_class.modifier: private static final
focal_class.original_string: private static final long M_IN_H = 60;
focal_class.type: long
focal_class.var_name: M_IN_H
focal_class.declarator: H_IN_DAY = 24
focal_class.modifier: private static final
focal_class.original_string: private static final long H_IN_DAY = 24;
focal_class.type: long
focal_class.var_name: H_IN_DAY
focal_class.declarator: DAYS_IN_YEAR = 365
focal_class.modifier: private static final
focal_class.original_string: private static final long DAYS_IN_YEAR = 365;
focal_class.type: long
focal_class.var_name: DAYS_IN_YEAR
focal_class.declarator: cacheDurationInSeconds = S_IN_M * M_IN_H * H_IN_DAY * DAYS_IN_YEAR
focal_class.modifier: private
focal_class.original_string: private long cacheDurationInSeconds = S_IN_M * M_IN_H * H_IN_DAY * DAYS_IN_YEAR;
focal_class.type: long
focal_class.var_name: cacheDurationInSeconds
focal_class.declarator: cacheDurationInMilliSeconds = cacheDurationInSeconds * MS_IN_S
focal_class.modifier: private
focal_class.original_string: private long cacheDurationInMilliSeconds = cacheDurationInSeconds * MS_IN_S;
focal_class.type: long
focal_class.var_name: cacheDurationInMilliSeconds
focal_class.declarator: HTTP_LAST_MODIFIED_HEADER = "Last-Modified"
focal_class.modifier: private static final
focal_class.original_string: private static final String HTTP_LAST_MODIFIED_HEADER = "Last-Modified";
focal_class.type: String
focal_class.var_name: HTTP_LAST_MODIFIED_HEADER
focal_class.declarator: HTTP_ACCEPT_ENCODING_HEADER = "Accept-Encoding"
focal_class.modifier: private static final
focal_class.original_string: private static final String HTTP_ACCEPT_ENCODING_HEADER = "Accept-Encoding";
focal_class.type: String
focal_class.var_name: HTTP_ACCEPT_ENCODING_HEADER
focal_class.declarator: HTTP_ACCEPT_ENCODING_GZIP = "gzip"
focal_class.modifier: private static final
focal_class.original_string: private static final String HTTP_ACCEPT_ENCODING_GZIP = "gzip";
focal_class.type: String
focal_class.var_name: HTTP_ACCEPT_ENCODING_GZIP
focal_class.declarator: HTTP_EXPIRES_HEADER = "Expires"
focal_class.modifier: private static final
focal_class.original_string: private static final String HTTP_EXPIRES_HEADER = "Expires";
focal_class.type: String
focal_class.var_name: HTTP_EXPIRES_HEADER
focal_class.declarator: HTTP_EXPIRES_HEADER_NOCACHE_VALUE = "Wed, 11 Jan 1984 05:00:00:GMT"
focal_class.modifier: private static final
focal_class.original_string: private static final String HTTP_EXPIRES_HEADER_NOCACHE_VALUE = "Wed, 11 Jan 1984 05:00:00:GMT";
focal_class.type: String
focal_class.var_name: HTTP_EXPIRES_HEADER_NOCACHE_VALUE
focal_class.declarator: HTTP_CACHE_CONTROL_HEADER = "Cache-Control"
focal_class.modifier: private static final
focal_class.original_string: private static final String HTTP_CACHE_CONTROL_HEADER = "Cache-Control";
focal_class.type: String
focal_class.var_name: HTTP_CACHE_CONTROL_HEADER
focal_class.declarator: HTTP_CACHE_CONTROL_HEADER_NOCACHE_VALUE =
  			"max-age=0, no-cache, no-store, must-revalidate"
focal_class.modifier: private static final
focal_class.original_string: private static final String HTTP_CACHE_CONTROL_HEADER_NOCACHE_VALUE =
  			"max-age=0, no-cache, no-store, must-revalidate";
focal_class.type: String
focal_class.var_name: HTTP_CACHE_CONTROL_HEADER_NOCACHE_VALUE
focal_class.declarator: HTTP_CACHE_PRAGMA = "Pragma"
focal_class.modifier: private static final
focal_class.original_string: private static final String HTTP_CACHE_PRAGMA = "Pragma";
focal_class.type: String
focal_class.var_name: HTTP_CACHE_PRAGMA
focal_class.declarator: HTTP_CACHE_PRAGMA_VALUE = "no-cache"
focal_class.modifier: private static final
focal_class.original_string: private static final String HTTP_CACHE_PRAGMA_VALUE = "no-cache";
focal_class.type: String
focal_class.var_name: HTTP_CACHE_PRAGMA_VALUE
focal_class.declarator: HTTP_CACHE_MAX_AGE_PREFIX = "max-age="
focal_class.modifier: private static final
focal_class.original_string: private static final String HTTP_CACHE_MAX_AGE_PREFIX = "max-age=";
focal_class.type: String
focal_class.var_name: HTTP_CACHE_MAX_AGE_PREFIX
focal_class.declarator: cacheIdentifiers = new String[] {".cache."}
focal_class.modifier: private
focal_class.original_string: private String[] cacheIdentifiers = new String[] {".cache."};
focal_class.type: String[]
focal_class.var_name: cacheIdentifiers
focal_class.declarator: cacheSuffixes = new String[] {".js", ".png", ".jpg", ".jpeg", ".gif", ".css", ".html"}
focal_class.modifier: private
focal_class.original_string: private String[] cacheSuffixes = new String[] {".js", ".png", ".jpg", ".jpeg", ".gif", ".css", ".html"};
focal_class.type: String[]
focal_class.var_name: cacheSuffixes
focal_class.declarator: noCacheIdentifiers = new String[] {".nocache."}
focal_class.modifier: private
focal_class.original_string: private String[] noCacheIdentifiers = new String[] {".nocache."};
focal_class.type: String[]
focal_class.var_name: noCacheIdentifiers
focal_class.declarator: noCacheSuffixes = new String[] {}
focal_class.modifier: private
focal_class.original_string: private String[] noCacheSuffixes = new String[] {};
focal_class.type: String[]
focal_class.var_name: noCacheSuffixes
focal_class.declarator: zipSuffixes = new String[] {".js", ".css", ".html"}
focal_class.modifier: private
focal_class.original_string: private String[] zipSuffixes = new String[] {".js", ".css", ".html"};
focal_class.type: String[]
focal_class.var_name: zipSuffixes
focal_class.declarator: skipPrefixes = new String[] {"/d/"}
focal_class.modifier: private
focal_class.original_string: private String[] skipPrefixes = new String[] {"/d/"};
focal_class.type: String[]
focal_class.var_name: skipPrefixes
focal_class.file: common-servlet/src/main/java/org/geomajas/servlet/CacheFilter.java
focal_class.identifier: CacheFilter
focal_class.interfaces: implements Filter
focal_class.class_method_signature: CacheFilter.destroy()
focal_class.full_signature: @Override public void destroy()
focal_class.identifier: destroy
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: void
focal_class.signature: void destroy()
focal_class.class_method_signature: CacheFilter.init(FilterConfig config)
focal_class.full_signature: @Override public void init(FilterConfig config)
focal_class.identifier: init
focal_class.modifiers: @Override public
focal_class.parameters: (FilterConfig config)
focal_class.return: void
focal_class.signature: void init(FilterConfig config)
focal_class.class_method_signature: CacheFilter.doFilter(ServletRequest request, ServletResponse response, FilterChain filterChain)
focal_class.full_signature: @Override @edu.umd.cs.findbugs.annotations.SuppressWarnings(value = "AvoidUsingHardCodedIP", justification = "double-safe check on localhost, ease configuration for development") public void doFilter(ServletRequest request, ServletResponse response, FilterChain filterChain)
focal_class.identifier: doFilter
focal_class.modifiers: @Override @edu.umd.cs.findbugs.annotations.SuppressWarnings(value = "AvoidUsingHardCodedIP", justification = "double-safe check on localhost, ease configuration for development") public
focal_class.parameters: (ServletRequest request, ServletResponse response, FilterChain filterChain)
focal_class.return: void
focal_class.signature: void doFilter(ServletRequest request, ServletResponse response, FilterChain filterChain)
focal_class.class_method_signature: CacheFilter.shouldCache(String requestUri)
focal_class.full_signature: public boolean shouldCache(String requestUri)
focal_class.identifier: shouldCache
focal_class.modifiers: public
focal_class.parameters: (String requestUri)
focal_class.return: boolean
focal_class.signature: boolean shouldCache(String requestUri)
focal_class.class_method_signature: CacheFilter.shouldNotCache(String requestUri)
focal_class.full_signature: public boolean shouldNotCache(String requestUri)
focal_class.identifier: shouldNotCache
focal_class.modifiers: public
focal_class.parameters: (String requestUri)
focal_class.return: boolean
focal_class.signature: boolean shouldNotCache(String requestUri)
focal_class.class_method_signature: CacheFilter.shouldCompress(String requestUri)
focal_class.full_signature: public boolean shouldCompress(String requestUri)
focal_class.identifier: shouldCompress
focal_class.modifiers: public
focal_class.parameters: (String requestUri)
focal_class.return: boolean
focal_class.signature: boolean shouldCompress(String requestUri)
focal_class.class_method_signature: CacheFilter.checkContains(String uri, String[] patterns)
focal_class.full_signature: public boolean checkContains(String uri, String[] patterns)
focal_class.identifier: checkContains
focal_class.modifiers: public
focal_class.parameters: (String uri, String[] patterns)
focal_class.return: boolean
focal_class.signature: boolean checkContains(String uri, String[] patterns)
focal_class.class_method_signature: CacheFilter.checkSuffixes(String uri, String[] patterns)
focal_class.full_signature: public boolean checkSuffixes(String uri, String[] patterns)
focal_class.identifier: checkSuffixes
focal_class.modifiers: public
focal_class.parameters: (String uri, String[] patterns)
focal_class.return: boolean
focal_class.signature: boolean checkSuffixes(String uri, String[] patterns)
focal_class.class_method_signature: CacheFilter.checkPrefixes(String uri, String[] patterns)
focal_class.full_signature: public boolean checkPrefixes(String uri, String[] patterns)
focal_class.identifier: checkPrefixes
focal_class.modifiers: public
focal_class.parameters: (String uri, String[] patterns)
focal_class.return: boolean
focal_class.signature: boolean checkPrefixes(String uri, String[] patterns)
focal_class.class_method_signature: CacheFilter.configureNoCaching(HttpServletResponse response)
focal_class.full_signature: @Api public static void configureNoCaching(HttpServletResponse response)
focal_class.identifier: configureNoCaching
focal_class.modifiers: @Api public static
focal_class.parameters: (HttpServletResponse response)
focal_class.return: void
focal_class.signature: void configureNoCaching(HttpServletResponse response)
focal_class.class_method_signature: CacheFilter.configureCaching(HttpServletResponse response)
focal_class.full_signature: private void configureCaching(HttpServletResponse response)
focal_class.identifier: configureCaching
focal_class.modifiers: private
focal_class.parameters: (HttpServletResponse response)
focal_class.return: void
focal_class.signature: void configureCaching(HttpServletResponse response)
focal_method.body: public boolean shouldCache(String requestUri) {
  		String uri = requestUri.toLowerCase();
  		return checkContains(uri, cacheIdentifiers) || checkSuffixes(uri, cacheSuffixes);
  	}
focal_method.class_method_signature: CacheFilter.shouldCache(String requestUri)
focal_method.full_signature: public boolean shouldCache(String requestUri)
focal_method.identifier: shouldCache
focal_method.invocations: toLowerCase checkContains checkSuffixes
focal_method.modifiers: public
focal_method.parameters: (String requestUri)
focal_method.return: boolean
focal_method.signature: boolean shouldCache(String requestUri)