|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface RequestHeaders
An injectable interface that provides access to HTTP request header information.
This interface can only be injected as part of the request or response processing
scope. Alternatively, the interface can be retrieved from a Request
instance
via its getHeaders()
method.
Context
Method Summary | |
---|---|
MultivaluedMap<String,String> |
asMap()
Get the map of HTTP message header names to their respective values. |
List<Locale> |
getAcceptableLanguages()
Get a list of languages that are acceptable for the response. |
List<MediaType> |
getAcceptableMediaTypes()
Get a list of media types that are acceptable for the response. |
Map<String,Cookie> |
getCookies()
Get any cookies that accompanied the request. |
Date |
getDate()
Get message date. |
String |
getHeader(String name)
Get a HTTP header as a single string value. |
List<String> |
getHeaderValues(String name)
Get the values of a single HTTP message header. |
Locale |
getLanguage()
Get the language of the entity |
int |
getLength()
Get Content-Length value. |
Link |
getLink(String relation)
Get the link for the relation. |
Link.Builder |
getLinkBuilder(String relation)
Convenience method that returns a Link.Builder for the relation. |
Set<Link> |
getLinks()
Get the links attached to the message as header. |
MediaType |
getMediaType()
Get the media type of the entity |
boolean |
hasLink(String relation)
Check if link for relation exists. |
Method Detail |
---|
Date getDate()
null
if not present.String getHeader(String name)
RuntimeDelegate.HeaderDelegate
if one is available
via RuntimeDelegate.createHeaderDelegate(java.lang.Class)
for the header value class or using its toString
method if a header
delegate is not available.
name
- the HTTP header.
null
is 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.asMap()
,
getHeaderValues(java.lang.String)
MultivaluedMap<String,String> asMap()
RuntimeDelegate.HeaderDelegate
if one is available
via RuntimeDelegate.createHeaderDelegate(java.lang.Class)
for the header value class or using its toString
method if a header
delegate is not available.
IllegalStateException
- if called outside of the message
processing scope.getHeader(java.lang.String)
,
getHeaderValues(java.lang.String)
List<String> getHeaderValues(String name)
asMap().get(name)
.
Each single header value is converted to String using a
RuntimeDelegate.HeaderDelegate
if one is available
via RuntimeDelegate.createHeaderDelegate(java.lang.Class)
for the header value class or using its toString
method if a header
delegate is not available.
name
- the header name, case insensitive.
IllegalStateException
- if called outside of the message
processing scope.asMap()
,
getHeader(java.lang.String)
Locale getLanguage()
int getLength()
MediaType getMediaType()
List<MediaType> getAcceptableMediaTypes()
List<Locale> getAcceptableLanguages()
Map<String,Cookie> getCookies()
Set<Link> getLinks()
Set
if no links are present. Never
returns null
.boolean hasLink(String relation)
relation
- link relation.
Link getLink(String relation)
relation
- link relation.
null
if not present.Link.Builder getLinkBuilder(String relation)
Link.Builder
for the relation.
relation
- link relation.
null
if not present.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |