|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface ResponseHeaders
An injectable interface that provides access to HTTP response header information.
This interface can only be injected as part of the response processing scope.
Alternatively, the interface can be retrieved from a Response
instance
via its getHeaders()
method.
Context
Method Summary | |
---|---|
MultivaluedMap<String,String> |
asMap()
Get the map of HTTP message header names to their respective values. |
Set<String> |
getAllowedMethods()
Get the allowed HTTP methods from the Allow HTTP header. |
Map<String,NewCookie> |
getCookies()
Get any new cookies set on the response message. |
Date |
getDate()
Get message date. |
EntityTag |
getEntityTag()
Get the entity tag. |
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 |
Date |
getLastModified()
Get the last modified date. |
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. |
URI |
getLocation()
Get the location. |
MediaType |
getMediaType()
Get the media type of the entity |
boolean |
hasLink(String relation)
Check if link for relation exists. |
Method Detail |
---|
Set<String> getAllowedMethods()
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()
Map<String,NewCookie> getCookies()
EntityTag getEntityTag()
null
if not present.Date getLastModified()
null
if not present.URI getLocation()
null
if not present.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 |