public interface HttpRequestContext extends javax.ws.rs.core.HttpHeaders, javax.ws.rs.core.Request, javax.ws.rs.core.SecurityContext, Traceable
ACCEPT, ACCEPT_CHARSET, ACCEPT_ENCODING, ACCEPT_LANGUAGE, AUTHORIZATION, CACHE_CONTROL, CONTENT_ENCODING, CONTENT_LANGUAGE, CONTENT_LENGTH, CONTENT_LOCATION, CONTENT_TYPE, COOKIE, DATE, ETAG, EXPIRES, HOST, IF_MATCH, IF_MODIFIED_SINCE, IF_NONE_MATCH, IF_UNMODIFIED_SINCE, LAST_MODIFIED, LOCATION, SET_COOKIE, USER_AGENT, VARY, WWW_AUTHENTICATE
Modifier and Type | Method and Description |
---|---|
URI |
getAbsolutePath()
Get the absolute path of the request.
|
javax.ws.rs.core.UriBuilder |
getAbsolutePathBuilder()
Get the absolute path of the request in the form of a UriBuilder.
|
javax.ws.rs.core.MediaType |
getAcceptableMediaType(List<javax.ws.rs.core.MediaType> mediaTypes)
Deprecated.
will stay in Jersey 1.x, use
Request.selectVariant(java.util.List)
as an alternative. |
List<javax.ws.rs.core.MediaType> |
getAcceptableMediaTypes(List<QualitySourceMediaType> priorityMediaTypes)
Deprecated.
will stay in Jersey 1.x, use
Request.selectVariant(java.util.List)
as an alternative. |
URI |
getBaseUri()
Get the base URI of the application.
|
javax.ws.rs.core.UriBuilder |
getBaseUriBuilder()
Get the base URI of the application in the form of a UriBuilder.
|
javax.ws.rs.core.MultivaluedMap<String,String> |
getCookieNameValueMap()
Get the cookie name value map.
|
<T> T |
getEntity(Class<T> type)
Get the request entity, returns null if the request does not
contain an entity body.
|
<T> T |
getEntity(Class<T> type,
Type genericType,
Annotation[] as)
Get the request entity, returns null if the request does not
contain an entity body.
|
Form |
getFormParameters()
Get the form parameters of the request entity.
|
String |
getHeaderValue(String name)
Get a HTTP header value.
|
String |
getPath()
Get the path of the current request relative to the base URI as
a string.
|
String |
getPath(boolean decode)
Get the path of the current request relative to the base URI as
a string.
|
List<javax.ws.rs.core.PathSegment> |
getPathSegments()
Get the path of the current request relative to the base URI as a
list of
PathSegment . |
List<javax.ws.rs.core.PathSegment> |
getPathSegments(boolean decode)
Get the path of the current request relative to the base URI as a
list of
PathSegment . |
javax.ws.rs.core.MultivaluedMap<String,String> |
getQueryParameters()
Get the URI query parameters of the current request.
|
javax.ws.rs.core.MultivaluedMap<String,String> |
getQueryParameters(boolean decode)
Get the URI query parameters of the current request.
|
URI |
getRequestUri()
Get the absolute request URI.
|
javax.ws.rs.core.UriBuilder |
getRequestUriBuilder()
Get the absolute request URI in the form of a UriBuilder.
|
getAcceptableLanguages, getAcceptableMediaTypes, getCookies, getLanguage, getMediaType, getRequestHeader, getRequestHeaders
evaluatePreconditions, evaluatePreconditions, evaluatePreconditions, evaluatePreconditions, getMethod, selectVariant
getAuthenticationScheme, getUserPrincipal, isSecure, isUserInRole
isTracingEnabled, trace
URI getBaseUri()
javax.ws.rs.core.UriBuilder getBaseUriBuilder()
URI getRequestUri()
IllegalStateException
- if called outside the scope of a requestjavax.ws.rs.core.UriBuilder getRequestUriBuilder()
IllegalStateException
- if called outside the scope of a requestURI getAbsolutePath()
uriInfo.getBase().resolve(uriInfo.getPath()).
IllegalStateException
- if called outside the scope of a requestjavax.ws.rs.core.UriBuilder getAbsolutePathBuilder()
IllegalStateException
- if called outside the scope of a requestString getPath()
getPath(true)
.IllegalStateException
- if called outside the scope of a requestString getPath(boolean decode)
decode
- controls whether sequences of escaped octets are decoded
(true) or not (false).IllegalStateException
- if called outside the scope of a requestList<javax.ws.rs.core.PathSegment> getPathSegments()
PathSegment
. This method is useful when the
path needs to be parsed, particularly when matrix parameters may be
present in the path. All sequences of escaped octets in path segments
and matrix parameter names and values are decoded,
equivalent to getPathSegments(true)
.PathSegment
. The matrix parameter
map of each path segment is also unmodifiable.IllegalStateException
- if called outside the scope of a requestPathSegment
,
Matrix URIsList<javax.ws.rs.core.PathSegment> getPathSegments(boolean decode)
PathSegment
. This method is useful when the
path needs to be parsed, particularly when matrix parameters may be
present in the path.decode
- controls whether sequences of escaped octets in path segments
and matrix parameter names and values are decoded (true) or not (false).PathSegment
. The matrix parameter
map of each path segment is also unmodifiable.IllegalStateException
- if called outside the scope of a requestPathSegment
,
Matrix URIsjavax.ws.rs.core.MultivaluedMap<String,String> getQueryParameters()
getQueryParameters(true)
.IllegalStateException
- if called outside the scope of a requestjavax.ws.rs.core.MultivaluedMap<String,String> getQueryParameters(boolean decode)
decode
- controls whether sequences of escaped octets in parameter
names and values are decoded (true) or not (false).IllegalStateException
- if called outside the scope of a requestString getHeaderValue(String name)
name
- the HTTP header@Deprecated javax.ws.rs.core.MediaType getAcceptableMediaType(List<javax.ws.rs.core.MediaType> mediaTypes)
Request.selectVariant(java.util.List)
as an alternative.mediaTypes
- the list of media types@Deprecated List<javax.ws.rs.core.MediaType> getAcceptableMediaTypes(List<QualitySourceMediaType> priorityMediaTypes)
Request.selectVariant(java.util.List)
as an alternative.priorityMediaTypes
- the list of media types that take priority,
ordered according to the quality source parameter, "qs" as the
primary key.javax.ws.rs.core.MultivaluedMap<String,String> getCookieNameValueMap()
<T> T getEntity(Class<T> type) throws javax.ws.rs.WebApplicationException
type
- the type of entityjavax.ws.rs.WebApplicationException
- if the content of the request
cannot be mapped to an entity of the requested type<T> T getEntity(Class<T> type, Type genericType, Annotation[] as) throws javax.ws.rs.WebApplicationException
type
- the type of entitygenericType
- type the generic type of entity, it is the responsibility
of the callee to ensure that the type and generic type are
consistent otherwise the behaviour of this method is undefined.as
- the annotations associated with the typejavax.ws.rs.WebApplicationException
- if the content of the request
cannot be mapped to an entity of the requested typeForm getFormParameters()
This method will ensure that the request entity is buffered such that it may be consumed by the application.
Copyright © 2013 Oracle Corporation. All rights reserved.