|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.sun.jersey.server.impl.model.HttpHelper
public final class HttpHelper
Helper classes for HTTP.
Constructor Summary | |
---|---|
HttpHelper()
|
Method Summary | |
---|---|
static List<AcceptableMediaType> |
getAccept(HttpRequestContext request)
Get the list of Media type from the "Accept" of an HTTP request. |
static List<AcceptableMediaType> |
getAccept(HttpRequestContext request,
List<QualitySourceMediaType> priorityMediaTypes)
|
static List<AcceptableToken> |
getAcceptCharset(HttpRequestContext request)
Get the list of language tag from the "Accept-Charset" of an HTTP request. |
static List<AcceptableToken> |
getAcceptEncoding(HttpRequestContext request)
Get the list of language tag from the "Accept-Charset" of an HTTP request. |
static List<AcceptableLanguageTag> |
getAcceptLangauge(HttpRequestContext request)
Deprecated. see getAcceptLanguage(com.sun.jersey.api.core.HttpRequestContext) . |
static List<AcceptableLanguageTag> |
getAcceptLanguage(HttpRequestContext request)
Get the list of language tag from the "Accept-Language" of an HTTP request. |
static 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(Object contentType)
Get the content type from an Object. |
static MediaType |
getContentType(String contentTypeString)
Get the content type from a String. |
static Set<MatchingEntityTag> |
getIfMatch(HttpRequestContext request)
|
static Set<MatchingEntityTag> |
getIfNoneMatch(HttpRequestContext request)
|
static Locale |
getLanguageTagAsLocale(String language)
|
static boolean |
produces(MediaType contentType,
List<MediaType> accept)
Ascertain if an entity of a specific Media type is capable of being produced from a list of Media type. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public HttpHelper()
Method Detail |
---|
public static MediaType getContentType(HttpRequestContext request)
request
- The HTTP request.
public static MediaType getContentType(String contentTypeString)
contentTypeString
- the content type as a String.
public static MediaType getContentType(Object contentType)
contentType
- the content type as an Object.
public static Locale getContentLanguageAsLocale(HttpRequestContext request)
request
- The HTTP request.
public static Locale getLanguageTagAsLocale(String language)
public static Set<MatchingEntityTag> getIfMatch(HttpRequestContext request)
public static Set<MatchingEntityTag> getIfNoneMatch(HttpRequestContext request)
public static List<AcceptableMediaType> getAccept(HttpRequestContext request)
request
- The HTTP request.
MediaTypes#ACCEPT_MEDIA_TYPE_COMPARATOR
).
If no "Accept" is present then a list with a single item of the Media
type "\*\/*" is returned.public static List<AcceptableMediaType> getAccept(HttpRequestContext request, List<QualitySourceMediaType> priorityMediaTypes)
@Deprecated public static List<AcceptableLanguageTag> getAcceptLangauge(HttpRequestContext request)
getAcceptLanguage(com.sun.jersey.api.core.HttpRequestContext)
.
request
- The HTTP request.
public static List<AcceptableLanguageTag> getAcceptLanguage(HttpRequestContext request)
request
- The HTTP request.
public static List<AcceptableToken> getAcceptCharset(HttpRequestContext request)
request
- The HTTP request.
public static List<AcceptableToken> getAcceptEncoding(HttpRequestContext request)
request
- The HTTP request.
public static boolean produces(MediaType contentType, 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 occuring first
(see MediaTypes#ACCEPT_MEDIA_TYPE_COMPARATOR
).
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |