Class AllowedContentEncodings
- java.lang.Object
-
- io.undertow.server.handlers.encoding.AllowedContentEncodings
-
- All Implemented Interfaces:
ConduitWrapper<org.xnio.conduits.StreamSinkConduit>
public class AllowedContentEncodings extends java.lang.Object implements ConduitWrapper<org.xnio.conduits.StreamSinkConduit>
An attachment that provides information about the current content encoding that will be chosen for the response- Author:
- Stuart Douglas
-
-
Field Summary
Fields Modifier and Type Field Description static AttachmentKey<AllowedContentEncodings>
ATTACHMENT_KEY
-
Constructor Summary
Constructors Constructor Description AllowedContentEncodings(HttpServerExchange exchange, java.util.List<io.undertow.server.handlers.encoding.EncodingMapping> encodings)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.String
getCurrentContentEncoding()
io.undertow.server.handlers.encoding.EncodingMapping
getEncoding()
boolean
isIdentity()
boolean
isNoEncodingsAllowed()
If the list of allowed encodings was empty then it means that no encodings were allowed, and identity was explicitly prohibited with a q value of 0.org.xnio.conduits.StreamSinkConduit
wrap(ConduitFactory<org.xnio.conduits.StreamSinkConduit> factory, HttpServerExchange exchange)
Wrap the conduit.
-
-
-
Field Detail
-
ATTACHMENT_KEY
public static final AttachmentKey<AllowedContentEncodings> ATTACHMENT_KEY
-
-
Constructor Detail
-
AllowedContentEncodings
public AllowedContentEncodings(HttpServerExchange exchange, java.util.List<io.undertow.server.handlers.encoding.EncodingMapping> encodings)
-
-
Method Detail
-
getCurrentContentEncoding
public java.lang.String getCurrentContentEncoding()
- Returns:
- The content encoding that will be set, given the current state of the HttpServerExchange
-
getEncoding
public io.undertow.server.handlers.encoding.EncodingMapping getEncoding()
-
isIdentity
public boolean isIdentity()
-
isNoEncodingsAllowed
public boolean isNoEncodingsAllowed()
If the list of allowed encodings was empty then it means that no encodings were allowed, and identity was explicitly prohibited with a q value of 0.
-
wrap
public org.xnio.conduits.StreamSinkConduit wrap(ConduitFactory<org.xnio.conduits.StreamSinkConduit> factory, HttpServerExchange exchange)
Description copied from interface:ConduitWrapper
Wrap the conduit. The wrapper should not returnnull
. If no wrapping is desired, the original conduit should be returned.- Specified by:
wrap
in interfaceConduitWrapper<org.xnio.conduits.StreamSinkConduit>
- Parameters:
factory
- the original conduitexchange
- the in-flight HTTP exchange- Returns:
- the replacement conduit
-
-