public final class HttpHelper
extends java.lang.Object
| Constructor and Description |
|---|
HttpHelper() |
| Modifier and Type | Method and Description |
|---|---|
static java.util.List<AcceptableMediaType> |
getAccept(HttpRequestContext request)
Get the list of Media type from the "Accept" of an HTTP request.
|
static java.util.List<AcceptableMediaType> |
getAccept(HttpRequestContext request,
java.util.List<QualitySourceMediaType> priorityMediaTypes) |
static java.util.List<AcceptableToken> |
getAcceptCharset(HttpRequestContext request)
Get the list of language tag from the "Accept-Charset" of an HTTP request.
|
static java.util.List<AcceptableToken> |
getAcceptEncoding(HttpRequestContext request)
Get the list of language tag from the "Accept-Charset" of an HTTP request.
|
static java.util.List<AcceptableLanguageTag> |
getAcceptLangauge(HttpRequestContext request)
Deprecated.
|
static java.util.List<AcceptableLanguageTag> |
getAcceptLanguage(HttpRequestContext request)
Get the list of language tag from the "Accept-Language" of an HTTP request.
|
static java.util.Locale |
getContentLanguageAsLocale(HttpRequestContext request)
Get the content language as a Locale instance.
|
static MediaType |
getContentType(HttpRequestContext request)
Get the content type from the "Content-Type" of an HTTP request.
|
static MediaType |
getContentType(java.lang.Object contentType)
Get the content type from an Object.
|
static MediaType |
getContentType(java.lang.String contentTypeString)
Get the content type from a String.
|
static java.util.Set<MatchingEntityTag> |
getIfMatch(HttpRequestContext request) |
static java.util.Set<MatchingEntityTag> |
getIfNoneMatch(HttpRequestContext request) |
static java.util.Locale |
getLanguageTagAsLocale(java.lang.String language) |
static boolean |
produces(MediaType contentType,
java.util.List<MediaType> accept)
Ascertain if an entity of a specific Media type is capable of being
produced from a list of Media type.
|
public static MediaType getContentType(HttpRequestContext request)
request - The HTTP request.public static MediaType getContentType(java.lang.String contentTypeString)
contentTypeString - the content type as a String.public static MediaType getContentType(java.lang.Object contentType)
contentType - the content type as an Object.public static java.util.Locale getContentLanguageAsLocale(HttpRequestContext request)
request - The HTTP request.public static java.util.Locale getLanguageTagAsLocale(java.lang.String language)
public static java.util.Set<MatchingEntityTag> getIfMatch(HttpRequestContext request)
public static java.util.Set<MatchingEntityTag> getIfNoneMatch(HttpRequestContext request)
public static java.util.List<AcceptableMediaType> getAccept(HttpRequestContext request)
request - The HTTP request.MediaTypes.MEDIA_TYPE_COMPARATOR).
If no "Accept" is present then a list with a single item of the Media
type "\*\/*" is returned.public static java.util.List<AcceptableMediaType> getAccept(HttpRequestContext request, java.util.List<QualitySourceMediaType> priorityMediaTypes)
@Deprecated public static java.util.List<AcceptableLanguageTag> getAcceptLangauge(HttpRequestContext request)
getAcceptLanguage(com.sun.jersey.api.core.HttpRequestContext).request - The HTTP request.public static java.util.List<AcceptableLanguageTag> getAcceptLanguage(HttpRequestContext request)
request - The HTTP request.public static java.util.List<AcceptableToken> getAcceptCharset(HttpRequestContext request)
request - The HTTP request.public static java.util.List<AcceptableToken> getAcceptEncoding(HttpRequestContext request)
request - The HTTP request.public static boolean produces(MediaType contentType, java.util.List<MediaType> accept)
contentType - The Media type.accept - The list of Media types of entities that may be produced. This list
MUST be ordered with the highest quality acceptable Media type occurring first
(see MediaTypes.MEDIA_TYPE_COMPARATOR).Copyright © 2015 Oracle Corporation. All Rights Reserved.