public class CompressionEncodingFilter extends Object implements EncodingFilter
| Constructor and Description |
|---|
CompressionEncodingFilter(CompressionConfig.CompressionModeI compressionMode,
int compressionMinSize,
String[] compressibleMimeTypes,
String[] noCompressionUserAgents,
String[] aliases)
Creates a new CompressionEncodingFilter based on the provided configuration
details.
|
CompressionEncodingFilter(CompressionConfig.CompressionModeI compressionMode,
int compressionMinSize,
String[] compressibleMimeTypes,
String[] noCompressionUserAgents,
String[] aliases,
boolean enableDecompression)
Creates a new CompressionEncodingFilter based on the provided configuration
details.
|
CompressionEncodingFilter(CompressionConfig compressionConfig,
String[] aliases) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
applyDecoding(HttpHeader httpPacket) |
boolean |
applyEncoding(HttpHeader httpPacket) |
protected static boolean |
canCompressHttpResponse(HttpResponsePacket response,
CompressionConfig compressionConfig,
String[] aliases)
Returns true if the
HttpResponsePacket could be
compressed, or false otherwise. |
protected static boolean |
canDecompressHttpRequest(HttpRequestPacket request,
CompressionConfig config,
String[] aliases)
Returns true if the
HttpResponsePacket could be
compressed, or false otherwise. |
public CompressionEncodingFilter(CompressionConfig compressionConfig, String[] aliases)
public CompressionEncodingFilter(CompressionConfig.CompressionModeI compressionMode, int compressionMinSize, String[] compressibleMimeTypes, String[] noCompressionUserAgents, String[] aliases)
compressionMode - is compression on, off, or forced.compressionMinSize - the minimum size, in bytes, the resource must
be before being considered for compression.compressibleMimeTypes - resource mime types that may be compressed.
if null or zero-length, then there will be no type restriction.noCompressionUserAgents - user agents for which compression will
not be performed. If null or zero-length, the user agent will not
be considered.aliases - aliases for the compression name as defined in the
accept-encoding header of the request.public CompressionEncodingFilter(CompressionConfig.CompressionModeI compressionMode, int compressionMinSize, String[] compressibleMimeTypes, String[] noCompressionUserAgents, String[] aliases, boolean enableDecompression)
compressionMode - is compression on, off, or forced.compressionMinSize - the minimum size, in bytes, the resource must
be before being considered for compression.compressibleMimeTypes - resource mime types that may be compressed.
if null or zero-length, then there will be no type restriction.noCompressionUserAgents - user agents for which compression will
not be performed. If null or zero-length, the user agent will not
be considered.aliases - aliases for the compression name as defined in the
accept-encoding header of the request.enableDecompression - enabled decompression of incoming data
according to the content-encoding headerpublic boolean applyEncoding(HttpHeader httpPacket)
applyEncoding in interface EncodingFilterpublic boolean applyDecoding(HttpHeader httpPacket)
applyDecoding in interface EncodingFilterprotected static boolean canCompressHttpResponse(HttpResponsePacket response, CompressionConfig compressionConfig, String[] aliases)
HttpResponsePacket could be
compressed, or false otherwise.
The method checks if client supports compression and if the resource,
that we are about to send matches CompressionConfig configuration.protected static boolean canDecompressHttpRequest(HttpRequestPacket request, CompressionConfig config, String[] aliases)
HttpResponsePacket could be
compressed, or false otherwise.
The method checks if client supports compression and if the resource,
that we are about to send matches CompressionConfig configuration.Copyright © 2017 Oracle Corporation. All Rights Reserved.