public final class HeaderHelper extends Object
| Modifier and Type | Field and Description |
|---|---|
static Comparator<QualityValue> |
QUALITY_VALUE_COMPARATOR
Comparator for tokens which have quality value.
|
| Modifier and Type | Method and Description |
|---|---|
static String |
convertToString(Collection<String> collection)
Convert Collection<String> to single String, where values separated by ','.
|
static List<AcceptToken> |
createAcceptedCharsetList(String header)
Create sorted by quality value 'accept-character' list.
|
static List<AcceptToken> |
createAcceptedEncodingList(String header)
Create sorted by quality value 'accept-encoding' list.
|
static List<AcceptLanguage> |
createAcceptedLanguageList(String header)
Create sorted by quality value accepted language list.
|
static List<AcceptMediaType> |
createAcceptedMediaTypeList(String header)
Create sorted by quality value accepted media type list.
|
static String |
formatDate(Date date)
Format
date in RFC 1123 format. |
static long |
getContentLengthLong(javax.ws.rs.core.MultivaluedMap<String,String> httpHeaders) |
static String |
getHeaderAsString(Object o)
Create string representation of Java Object for adding to response.
|
static List<javax.ws.rs.core.Cookie> |
parseCookies(String cookie)
Parse cookie header string and create collection of cookie from it.
|
static Date |
parseDateHeader(String header)
Parse date header.
|
public static final Comparator<QualityValue> QUALITY_VALUE_COMPARATOR
QualityValuepublic static List<AcceptMediaType> createAcceptedMediaTypeList(String header)
header - source header stringpublic static List<AcceptLanguage> createAcceptedLanguageList(String header)
header - source header stringpublic static List<AcceptToken> createAcceptedCharsetList(String header)
header - source header stringpublic static List<AcceptToken> createAcceptedEncodingList(String header)
header - source header stringpublic static List<javax.ws.rs.core.Cookie> parseCookies(String cookie)
cookie - the cookie string.public static Date parseDateHeader(String header)
header - source date headerpublic static String formatDate(Date date)
date in RFC 1123 format.date - datepublic static long getContentLengthLong(javax.ws.rs.core.MultivaluedMap<String,String> httpHeaders)
httpHeaders - HTTP headerspublic static String getHeaderAsString(Object o)
Object.toString().o - HTTP header as Java type.public static String convertToString(Collection<String> collection)
collection - the source listCopyright © 2012–2016 Codenvy, S.A.. All rights reserved.