Class ContentCodecRegistry
- java.lang.Object
-
- org.apache.hc.client5.http.entity.compress.ContentCodecRegistry
-
@Internal @Contract(threading=STATELESS) public final class ContentCodecRegistry extends java.lang.ObjectRegistry of encode/decode transformations for HTTP content codings.Entries are wired once at class-load time and exposed via an unmodifiable map. Built-in gzip/deflate are always available. Additional codecs are discovered reflectively:
- Commons Compress codecs, when the library and (if required) its helper JARs are present.
- Decode-only Brotli via brotli4j, when present on the classpath. This does
not affect the advertised
Accept-Encodingunless an encoder is also registered.
- Since:
- 5.6
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description (package private) static classContentCodecRegistry.Codec
-
Field Summary
Fields Modifier and Type Field Description private static java.util.Map<ContentCoding,ContentCodecRegistry.Codec>REGISTRY
-
Constructor Summary
Constructors Modifier Constructor Description privateContentCodecRegistry()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description private static java.util.Map<ContentCoding,ContentCodecRegistry.Codec>build()static java.util.function.UnaryOperator<org.apache.hc.core5.http.HttpEntity>decoder(ContentCoding coding)static java.util.function.UnaryOperator<org.apache.hc.core5.http.HttpEntity>encoder(ContentCoding coding)static org.apache.hc.core5.http.HttpEntityunwrap(ContentCoding c, org.apache.hc.core5.http.HttpEntity src)static org.apache.hc.core5.http.HttpEntitywrap(ContentCoding c, org.apache.hc.core5.http.HttpEntity src)
-
-
-
Field Detail
-
REGISTRY
private static final java.util.Map<ContentCoding,ContentCodecRegistry.Codec> REGISTRY
-
-
Method Detail
-
build
private static java.util.Map<ContentCoding,ContentCodecRegistry.Codec> build()
-
wrap
public static org.apache.hc.core5.http.HttpEntity wrap(ContentCoding c, org.apache.hc.core5.http.HttpEntity src)
-
unwrap
public static org.apache.hc.core5.http.HttpEntity unwrap(ContentCoding c, org.apache.hc.core5.http.HttpEntity src)
-
decoder
public static java.util.function.UnaryOperator<org.apache.hc.core5.http.HttpEntity> decoder(ContentCoding coding)
-
encoder
public static java.util.function.UnaryOperator<org.apache.hc.core5.http.HttpEntity> encoder(ContentCoding coding)
-
-