public class GZIPContentEncodingFilter extends java.lang.Object implements ContainerRequestFilter, ContainerResponseFilter
If the request contains a Content-Encoding header of "gzip" then the request entity (if any) is uncompressed using gzip.
If the request contains a Accept-Encoding header that contains "gzip" then the response entity (if any) is compressed using gzip and a Content-Encoding header of "gzip" is added to the response.
When an application is deployed as a Servlet or Filter this Jersey filter can be registered using the following initialization parameters:
<init-param>
<param-name>com.sun.jersey.spi.container.ContainerRequestFilters</param-name>
<param-value>com.sun.jersey.api.container.filter.GZIPContentEncodingFilter</param-value>
</init-param>
<init-param>
<param-name>com.sun.jersey.spi.container.ContainerResponseFilters</param-name>
<param-value>com.sun.jersey.api.container.filter.GZIPContentEncodingFilter</param-value>
</init-param>
com.sun.jersey.api.container.filter| Constructor and Description |
|---|
GZIPContentEncodingFilter() |
| Modifier and Type | Method and Description |
|---|---|
ContainerRequest |
filter(ContainerRequest request)
Filter the request.
|
ContainerResponse |
filter(ContainerRequest request,
ContainerResponse response)
Filter the response.
|
public ContainerRequest filter(ContainerRequest request)
ContainerRequestFilterAn implementation may modify the state of the request or create a new instance.
filter in interface ContainerRequestFilterrequest - the request.public ContainerResponse filter(ContainerRequest request, ContainerResponse response)
ContainerResponseFilterAn implementation may modify the state of the response or return a new instance.
filter in interface ContainerResponseFilterrequest - the request.response - the response.Copyright © 2015 Oracle Corporation. All Rights Reserved.