com.atlassian.gzipfilter
Class GzipFilter
java.lang.Object
com.atlassian.gzipfilter.GzipFilter
- All Implemented Interfaces:
- javax.servlet.Filter
- Direct Known Subclasses:
- EnabledGzipFilter
public class GzipFilter
- extends Object
This filter works in conjunction with a UserAgentBasedGzipSelectorFactory to determine whether to return noop
selector or gzip-ing one. It relies on UserAgentBasedGzipSelectorFactory which check request browser and response
mime types.
Default gzippable mime types are set to UserAgentBasedGzipSelectorFactory.DEFAULT_COMPRESSABLE_MIME_TYPES.
Default non-gzippable user agents are set to UserAgentBasedGzipSelectorFactory.NO_COMPRESSION_USER_AGENTS_PARAM_NAME.
It's possible to override any of these settings via UserAgentBasedGzipSelectorFactory.COMPRESSABLE_MIME_TYPES_PARAM_NAME
UserAgentBasedGzipSelectorFactory.NO_COMPRESSION_USER_AGENTS_PARAM_NAME
init params respectively
Please note that historically gzip check was based on url-rewrite and this will now check for the existence of
/WEB-INF/urlrewrite-gzip.xml or urlrewrite.configfile init param in order to fail fast if any are found.
|
Method Summary |
void |
destroy()
|
void |
doFilter(javax.servlet.ServletRequest req,
javax.servlet.ServletResponse res,
javax.servlet.FilterChain chain)
|
protected GzipCompatibilitySelectorFactory |
getFactory()
|
javax.servlet.FilterConfig |
getFilterConfig()
Deprecated. Not needed in final version of Servlet 2.3 API - replaced by init(). |
void |
init(javax.servlet.FilterConfig filterConfig)
|
void |
setFilterConfig(javax.servlet.FilterConfig filterConfig)
Deprecated. Not needed in final version of Servlet 2.3 API - replaced by init(). |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
LEGACY_INIT_PARAM
protected static final String LEGACY_INIT_PARAM
- See Also:
- Constant Field Values
LEGACY_CONFIG_FILE
protected static final String LEGACY_CONFIG_FILE
- See Also:
- Constant Field Values
GzipFilter
public GzipFilter(GzipFilterIntegration integration)
init
public void init(javax.servlet.FilterConfig filterConfig)
throws javax.servlet.ServletException
- Specified by:
init in interface javax.servlet.Filter
- Throws:
javax.servlet.ServletException
doFilter
public void doFilter(javax.servlet.ServletRequest req,
javax.servlet.ServletResponse res,
javax.servlet.FilterChain chain)
throws IOException,
javax.servlet.ServletException
- Throws:
IOException
javax.servlet.ServletException
getFactory
protected GzipCompatibilitySelectorFactory getFactory()
getFilterConfig
public javax.servlet.FilterConfig getFilterConfig()
- Deprecated. Not needed in final version of Servlet 2.3 API - replaced by init().
setFilterConfig
public void setFilterConfig(javax.servlet.FilterConfig filterConfig)
- Deprecated. Not needed in final version of Servlet 2.3 API - replaced by init().
destroy
public void destroy()
- Specified by:
destroy in interface javax.servlet.Filter
Copyright © 2015 Atlassian. All rights reserved.