public abstract class AcceptHelper extends Object
Accept
, Accept-Charset
,
Accept-Encoding
or Accept-Language
HTTP headers.Constructor and Description |
---|
AcceptHelper() |
Modifier and Type | Method and Description |
---|---|
static String |
selectAcceptItem(String acceptedItems,
String[] supportedItems)
Evaluate an
Accept-* header and match it against a list of supported
server-side items based on exact string matching. |
static String |
selectAcceptItem(String acceptedItems,
String[] supportedItems,
AcceptMatcher matcher)
Evaluate an
Accept-* header and match it against a list of supported
server-side items. |
public static String selectAcceptItem(String acceptedItems, String[] supportedItems)
Accept-*
header and match it against a list of supported
server-side items based on exact string matching.acceptedItems
- The value of an Accept-*
header.supportedItems
- The list of server-side items. (locales, encodings,...)null
, if no requested item matches any of the server-side
values.public static String selectAcceptItem(String acceptedItems, String[] supportedItems, AcceptMatcher matcher)
Accept-*
header and match it against a list of supported
server-side items.acceptedItems
- The value of an Accept-*
header.supportedItems
- The list of server-side items. (locales, encodings,...)matcher
- A matcher for allowing fuzzy matches or null
to
use exact matching through String.equals(Object)
.null
, if no requested item matches any of the server-side
values.Copyright © 2018 Clazzes.org. All rights reserved.