public class GZIPContentEncodingFilter extends ClientFilter
The request will be modified to set the Accept-Encoding header to "gzip" if that header has not already been set by the client.
If the request contains an entity and a Content-Encoding header of "gzip" then the entity will be compressed using gzip. If configured, and there does not exist a Content-Encoding header of "gzip" then such a header is added to the request and the entity will be compressed using gzip.
If the response has a Content-Encoding header of "gzip" then then the response entity will be uncompressed using gzip.
Constructor and Description |
---|
GZIPContentEncodingFilter()
Create a GZIP Content-Encoding filter that compresses the request
entity.
|
GZIPContentEncodingFilter(boolean compressRequestEntity)
Create a GZIP Content-Encoding filter.
|
Modifier and Type | Method and Description |
---|---|
ClientResponse |
handle(ClientRequest request)
Handle a HTTP request as a
ClientRequest and return the HTTP
response as a ClientResponse . |
getNext
public GZIPContentEncodingFilter()
public GZIPContentEncodingFilter(boolean compressRequestEntity)
compressRequestEntity
- if true the request entity (if any)
is always compressed, otherwise the request entity is compressed
only if there exists a Content-Encoding header whose
value is "gzip".public ClientResponse handle(ClientRequest request) throws ClientHandlerException
ClientHandler
ClientRequest
and return the HTTP
response as a ClientResponse
.handle
in interface ClientHandler
handle
in class ClientFilter
request
- the HTTP request.ClientHandlerException
- if the client
handler fails to process the request or response.Copyright © 2016 Oracle Corporation. All Rights Reserved.