public class EncodingRegistry extends Object
Constructor and Description |
---|
EncodingRegistry()
Constructs the
EncodingRegistry with IdentityContentEncoding , IdentityTransferEncoding
and ChunkedTransferCodingHandler registered. |
Modifier and Type | Method and Description |
---|---|
ContentEncoding |
getAcceptEncodingHandler(String encoding)
Returns the most suitable
ContentEncoding to match the encodings described in
Accept-Encoding header. |
TransferEncoding |
getChunkedTransferEncoding()
Return the
ContentEncoding corresponding to chunked transfer coding. |
ContentEncoding |
getContentEncoding(String encoding)
Return the
ContentEncoding corresponding to the given encoding. |
TransferEncoding |
getIdentityTransferCodingHandler()
Return the
ContentEncoding corresponding to identity transfer coding (i.e. |
TransferEncoding |
getTransferEncoding(String encoding)
Return the
TransferEncoding corresponding to the given encoding. |
void |
registerContentEncoding(ContentEncoding handler)
Registers a new HTTP content encoding handler.
|
void |
registerTransferEncoding(TransferEncoding handler)
Registers a new HTTP transfer coding handler.
|
public EncodingRegistry()
EncodingRegistry
with IdentityContentEncoding
, IdentityTransferEncoding
and ChunkedTransferCodingHandler
registered.@Nullable public ContentEncoding getAcceptEncodingHandler(@Nullable String encoding)
ContentEncoding
to match the encodings described in
Accept-Encoding
header.encoding
- is on the form gzip, identity
or gzip; q=0.8, identity; q=0.2
.ContentEncoding
, or null
if no suitable handler can be found.public TransferEncoding getChunkedTransferEncoding()
ContentEncoding
corresponding to chunked transfer coding.ContentEncoding
corresponding to chunked transfer coding.@Nullable public ContentEncoding getContentEncoding(@Nullable String encoding)
ContentEncoding
corresponding to the given encoding.encoding
- case insensitive (See RFC2616, 3.5).public TransferEncoding getIdentityTransferCodingHandler()
ContentEncoding
corresponding to identity transfer coding (i.e. no transfer coding).ContentEncoding
corresponding to identity transfer coding (i.e. no transfer coding)@Nullable public TransferEncoding getTransferEncoding(@Nullable String encoding)
TransferEncoding
corresponding to the given encoding.encoding
- case insensitive (See RFC2616, 3.5).public void registerContentEncoding(ContentEncoding handler)
handler
- the ContentEncoding
to register.public void registerTransferEncoding(TransferEncoding handler)
handler
- the TransferEncoding
to register.