1 package com.atlassian.gzipfilter.integration;
2
3 import javax.servlet.http.HttpServletRequest;
4
5 /**
6 * This interface is the way that applications integrate with the {@link com.atlassian.gzipfilter.GzipFilter}.
7 * <p/>
8 * By using an interface instead of an abstract class, we avoid the
9 * <a href="http://en.wikipedia.org/wiki/Fragile_base_class">Fragile Base Class</a> problem.
10 */
11 public interface GzipFilterIntegration
12 {
13 /**
14 *
15 * @return Whether this application has gzip enabled or not
16 */
17 boolean useGzip();
18
19 /**
20 * What response encoding to use. This is primarily used when handling the parsing of
21 * writers to streams and vice-versa. Usually this is UTF-8, but depending on your application
22 * this may be different.
23 *
24 * @param request If you wish to parse the request for the request encoding
25 * @return An encoding supported by java
26 */
27 String getResponseEncoding(HttpServletRequest request);
28
29 }