Package org.jboss.resteasy.specimpl
Class ResteasyHttpHeaders
java.lang.Object
org.jboss.resteasy.specimpl.ResteasyHttpHeaders
- All Implemented Interfaces:
HttpHeaders
- Version:
- $Revision: 1 $
- Author:
- Bill Burke
-
Field Summary
Fields inherited from interface jakarta.ws.rs.core.HttpHeaders
ACCEPT, ACCEPT_CHARSET, ACCEPT_ENCODING, ACCEPT_LANGUAGE, ALLOW, AUTHORIZATION, CACHE_CONTROL, CONTENT_DISPOSITION, CONTENT_ENCODING, CONTENT_ID, CONTENT_LANGUAGE, CONTENT_LENGTH, CONTENT_LOCATION, CONTENT_TYPE, COOKIE, DATE, ETAG, EXPECT, EXPIRES, HOST, IF_MATCH, IF_MODIFIED_SINCE, IF_NONE_MATCH, IF_UNMODIFIED_SINCE, LAST_EVENT_ID_HEADER, LAST_MODIFIED, LINK, LOCATION, RETRY_AFTER, SET_COOKIE, USER_AGENT, VARY, WWW_AUTHENTICATE -
Constructor Summary
ConstructorsConstructorDescriptionResteasyHttpHeaders(MultivaluedMap<String, String> requestHeaders) ResteasyHttpHeaders(MultivaluedMap<String, String> requestHeaders, boolean eagerlyInitializeEntrySet) ResteasyHttpHeaders(MultivaluedMap<String, String> requestHeaders, Map<String, Cookie> cookies) ResteasyHttpHeaders(MultivaluedMap<String, String> requestHeaders, Map<String, Cookie> cookies, boolean eagerlyInitializeEntrySet) -
Method Summary
Modifier and TypeMethodDescriptionGet a list of languages that are acceptable for the response.Get a list of media types that are acceptable for the response.Get any cookies that accompanied the request.getDate()Get message date.getHeaderString(String name) Get a HTTP header as a single string value.Get the language of the request entity.intGet Content-Length value.Get the media type of the request entity.getRequestHeader(String name) Get the values of a HTTP request header if the header exists on the current request.Get the values of HTTP request headers.voidsetCookies(Map<String, Cookie> cookies) void
-
Constructor Details
-
ResteasyHttpHeaders
-
ResteasyHttpHeaders
public ResteasyHttpHeaders(MultivaluedMap<String, String> requestHeaders, boolean eagerlyInitializeEntrySet) -
ResteasyHttpHeaders
-
ResteasyHttpHeaders
-
-
Method Details
-
getRequestHeaders
Description copied from interface:HttpHeadersGet the values of HTTP request headers. The returned Map is case-insensitive wrt. keys and is read-only. The method never returnsnull.- Specified by:
getRequestHeadersin interfaceHttpHeaders- Returns:
- a read-only map of header names and values.
-
getMutableHeaders
-
testParsing
public void testParsing() -
getRequestHeader
Description copied from interface:HttpHeadersGet the values of a HTTP request header if the header exists on the current request. The returned value will be a read-only List if the specified header exists ornullif it does not. This is a shortcut forgetRequestHeaders().get(name).- Specified by:
getRequestHeaderin interfaceHttpHeaders- Parameters:
name- the header name, case insensitive.- Returns:
- a read-only list of header values if the specified header exists, otherwise
null.
-
getCookies
Description copied from interface:HttpHeadersGet any cookies that accompanied the request.- Specified by:
getCookiesin interfaceHttpHeaders- Returns:
- a read-only map of cookie name (String) to Cookie.
-
getMutableCookies
-
setCookies
-
getDate
Description copied from interface:HttpHeadersGet message date.- Specified by:
getDatein interfaceHttpHeaders- Returns:
- the message date, otherwise
nullif not present.
-
getHeaderString
Description copied from interface:HttpHeadersGet a HTTP header as a single string value.
Each single header value is converted to String using aRuntimeDelegate.HeaderDelegateif one is available viaRuntimeDelegate.createHeaderDelegate(java.lang.Class)for the header value class or using itstoStringmethod if a header delegate is not available.- Specified by:
getHeaderStringin interfaceHttpHeaders- Parameters:
name- the HTTP header.- Returns:
- the HTTP header value. If the HTTP header is not present then
nullis returned. If the HTTP header is present but has no value then the empty string is returned. If the HTTP header is present more than once then the values of joined together and separated by a ',' character. - See Also:
-
getLanguage
Description copied from interface:HttpHeadersGet the language of the request entity.- Specified by:
getLanguagein interfaceHttpHeaders- Returns:
- the language of the entity or
nullif not specified.
-
getLength
public int getLength()Description copied from interface:HttpHeadersGet Content-Length value.- Specified by:
getLengthin interfaceHttpHeaders- Returns:
- Content-Length as integer if present and valid number. In other cases returns -1.
-
getMediaType
Description copied from interface:HttpHeadersGet the media type of the request entity.- Specified by:
getMediaTypein interfaceHttpHeaders- Returns:
- the media type or
nullif there is no request entity.
-
getAcceptableMediaTypes
Description copied from interface:HttpHeadersGet a list of media types that are acceptable for the response.
If no acceptable media types are specified, a read-only list containing a singlewildcard media typeinstance is returned.- Specified by:
getAcceptableMediaTypesin interfaceHttpHeaders- Returns:
- a read-only list of requested response media types sorted according to their q-value, with highest preference first.
-
getAcceptableLanguages
Description copied from interface:HttpHeadersGet a list of languages that are acceptable for the response.
If no acceptable languages are specified, a read-only list containing a single wildcardLocaleinstance (with language field set to "*") is returned.- Specified by:
getAcceptableLanguagesin interfaceHttpHeaders- Returns:
- a read-only list of acceptable languages sorted according to their q-value, with highest preference first.
-