io.undertow.server.handlers.encoding

## Class AllowedContentEncodings

- java.lang.Object
- - io.undertow.server.handlers.encoding.AllowedContentEncodings

All Implemented Interfaces:
  ConduitWrapper<org.xnio.conduits.StreamSinkConduit>

    public class AllowedContentEncodings
    extends 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
`static AttachmentKey<AllowedContentEncodings>` `ATTACHMENT_KEY`

### Constructor Summary

Constructors
Constructor and Description
`AllowedContentEncodings(HttpServerExchange exchange, List<io.undertow.server.handlers.encoding.EncodingMapping> encodings)`

### Method Summary

All Methods Instance Methods Concrete Methods
`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.

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Field Detail

#### ATTACHMENT_KEY

    public static final AttachmentKey<AllowedContentEncodings> ATTACHMENT_KEY

### Constructor Detail

#### AllowedContentEncodings

    public AllowedContentEncodings(HttpServerExchange exchange,
                                   List<io.undertow.server.handlers.encoding.EncodingMapping> encodings)

### Method Detail

#### getCurrentContentEncoding

    public 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 return `null`. If no wrapping is desired, the original conduit should be returned.

Specified by:
  `wrap` in interface `ConduitWrapper<org.xnio.conduits.StreamSinkConduit>`
Parameters:
  `factory` - the original conduit
  `exchange` - the in-flight HTTP exchange
Returns:
  the replacement conduit