public final class HeaderUtils
extends Object
| Modifier and Type | Method and Description |
|---|---|
static ContentCodec |
encodingFor(Collection<ContentCodec> allowedList,
CharSequence name)
Deprecated.
|
static <T> T |
encodingForRaw(List<T> supportedEncoders,
Function<T,CharSequence> messageEncodingFunc,
CharSequence name)
Get the first encoding that matches
name from supportedEncoders. |
static ContentCodec |
negotiateAcceptedEncoding(CharSequence acceptEncodingHeaderValue,
List<ContentCodec> serverSupportedEncodings)
Deprecated.
|
static ContentCodec |
negotiateAcceptedEncoding(List<ContentCodec> clientSupportedEncodings,
List<ContentCodec> serverSupportedEncodings)
Deprecated.
|
static <T> T |
negotiateAcceptedEncodingRaw(CharSequence acceptEncodingHeaderValue,
List<T> supportedEncoders,
Function<T,CharSequence> messageEncodingFunc)
Get an encoder from
supportedEncoders that is acceptable as referenced by
acceptEncodingHeaderValue. |
@Deprecated
@Nullable
public static ContentCodec negotiateAcceptedEncoding(@Nullable
CharSequence acceptEncodingHeaderValue,
List<ContentCodec> serverSupportedEncodings)
negotiateAcceptedEncodingRaw(CharSequence, List, Function).'Accepted-Encoding' incoming header on the request.
If no supported encodings are configured then the result is always null
If no accepted encodings are present in the request then the result is always null
In all other cases, the first matching encoding (that is NOT Identity.identity()) is preferred,
otherwise null is returned.
acceptEncodingHeaderValue - The accept encoding header value.serverSupportedEncodings - The server supported codings as configured.ContentCodec that satisfies both client and server needs,
null if none found or matched to Identity.identity()@Nullable
public static <T> T negotiateAcceptedEncodingRaw(@Nullable
CharSequence acceptEncodingHeaderValue,
List<T> supportedEncoders,
Function<T,CharSequence> messageEncodingFunc)
supportedEncoders that is acceptable as referenced by
acceptEncodingHeaderValue.T - The type containing the encoder.acceptEncodingHeaderValue - The accept encoding header value.supportedEncoders - The supported encoders.messageEncodingFunc - Accessor to get the encoder form an element of supportedEncoders.supportedEncoders that is acceptable as referenced by
acceptEncodingHeaderValue.@Deprecated
@Nullable
public static ContentCodec negotiateAcceptedEncoding(List<ContentCodec> clientSupportedEncodings,
List<ContentCodec> serverSupportedEncodings)
negotiateAcceptedEncodingRaw(CharSequence, List, Function).
If no supported encodings are passed then the result is always null
Otherwise, the first matching encoding (that is NOT Identity.identity()) is preferred,
or null is returned.
clientSupportedEncodings - The client supported codings as found in the HTTP header.serverSupportedEncodings - The server supported codings as configured.ContentCodec that satisfies both client and server needs,
null if none found or matched to Identity.identity()@Deprecated
@Nullable
public static ContentCodec encodingFor(Collection<ContentCodec> allowedList,
@Nullable
CharSequence name)
encodingForRaw(List, Function, CharSequence).ContentCodec that matches the name within the allowedList.
if name is null or empty it results in null .
If name is 'identity' this will always result in
Identity.identity() regardless of its presence in the allowedList.allowedList - the source list to find a matching codec from.name - the codec name used for the equality predicate.name.@Nullable
public static <T> T encodingForRaw(List<T> supportedEncoders,
Function<T,CharSequence> messageEncodingFunc,
CharSequence name)
name from supportedEncoders.T - The type containing the encoder.supportedEncoders - The List of supported encoders.messageEncodingFunc - A means to access the supported encoding name from an element in
supportedEncoders.name - The encoding name.name from supportedEncoders.