Class ContainerRequest
- java.lang.Object
-
- org.glassfish.jersey.message.internal.InboundMessageContext
-
- org.glassfish.jersey.server.ContainerRequest
-
- All Implemented Interfaces:
javax.ws.rs.container.ContainerRequestContext
,javax.ws.rs.core.HttpHeaders
,javax.ws.rs.core.Request
,PropertiesDelegate
public class ContainerRequest extends InboundMessageContext implements javax.ws.rs.container.ContainerRequestContext, javax.ws.rs.core.Request, javax.ws.rs.core.HttpHeaders, PropertiesDelegate
Jersey container request context. An instance of the request context is passed by the container to theApplicationHandler
for each incoming client request.
-
-
Field Summary
-
Fields inherited from interface javax.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, 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
Constructors Constructor Description ContainerRequest(java.net.URI baseUri, java.net.URI requestUri, java.lang.String httpMethod, javax.ws.rs.core.SecurityContext securityContext, PropertiesDelegate propertiesDelegate)
Create new Jersey container request context.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
abortWith(javax.ws.rs.core.Response response)
(package private) void
checkState()
Check if the container request has been properly initialized for processing.private static <T> java.lang.Iterable<T>
emptyIfNull(java.lang.Iterable<T> iterable)
private java.lang.String
encodedRelativePath()
private javax.ws.rs.core.Response.ResponseBuilder
evaluateIfMatch(javax.ws.rs.core.EntityTag eTag)
private javax.ws.rs.core.Response.ResponseBuilder
evaluateIfModifiedSince(long lastModified)
private javax.ws.rs.core.Response.ResponseBuilder
evaluateIfModifiedSince(long lastModified, java.lang.String ifModifiedSinceHeader)
private javax.ws.rs.core.Response.ResponseBuilder
evaluateIfNoneMatch(javax.ws.rs.core.EntityTag eTag)
private javax.ws.rs.core.Response.ResponseBuilder
evaluateIfNoneMatch(javax.ws.rs.core.EntityTag eTag, java.util.Set<? extends javax.ws.rs.core.EntityTag> matchingTags, boolean isGetOrHead)
private javax.ws.rs.core.Response.ResponseBuilder
evaluateIfUnmodifiedSince(long lastModified)
javax.ws.rs.core.Response.ResponseBuilder
evaluatePreconditions()
javax.ws.rs.core.Response.ResponseBuilder
evaluatePreconditions(java.util.Date lastModified)
javax.ws.rs.core.Response.ResponseBuilder
evaluatePreconditions(java.util.Date lastModified, javax.ws.rs.core.EntityTag eTag)
javax.ws.rs.core.Response.ResponseBuilder
evaluatePreconditions(javax.ws.rs.core.EntityTag eTag)
javax.ws.rs.core.Response
getAbortResponse()
Get the request filter chain aborting response if set, ornull
otherwise.java.net.URI
getAbsolutePath()
Get the absolute path of the request.java.util.List<java.util.Locale>
getAcceptableLanguages()
java.util.List<javax.ws.rs.core.MediaType>
getAcceptableMediaTypes()
java.net.URI
getBaseUri()
Get base request URI.java.util.Map<java.lang.String,javax.ws.rs.core.Cookie>
getCookies()
private Inflector<RequestProcessingContext,ContainerResponse>
getInflector()
java.lang.String
getMethod()
java.lang.String
getPath(boolean decode)
Get the path of the current request relative to the application root (base) URI as a string.PropertiesDelegate
getPropertiesDelegate()
Get the underlying properties delegate.java.lang.Object
getProperty(java.lang.String name)
Returns the property with the given name registered in the current request/response exchange context, ornull
if there is no property by that name.java.util.Collection<java.lang.String>
getPropertyNames()
Returns an immutablecollection
containing the property names available within the context of the current request/response exchange context.protected java.lang.Iterable<javax.ws.rs.ext.ReaderInterceptor>
getReaderInterceptors()
Get all reader interceptors applicable to this request.javax.ws.rs.core.Request
getRequest()
(package private) java.lang.Iterable<RankedProvider<javax.ws.rs.container.ContainerRequestFilter>>
getRequestFilters()
Get all bound request filters applicable to this request.java.util.List<java.lang.String>
getRequestHeader(java.lang.String name)
Get the values of a HTTP request header.javax.ws.rs.core.MultivaluedMap<java.lang.String,java.lang.String>
getRequestHeaders()
Get the values of HTTP request headers.RequestScopedInitializer
getRequestScopedInitializer()
Get a custom container extensions initializer for the current request.java.net.URI
getRequestUri()
Get request URI.(package private) java.lang.Iterable<RankedProvider<javax.ws.rs.container.ContainerResponseFilter>>
getResponseFilters()
Get all bound response filters applicable to this request.ContainerResponseWriter
getResponseWriter()
Get the container response writer for the current request.javax.ws.rs.core.SecurityContext
getSecurityContext()
ExtendedUriInfo
getUriInfo()
(package private) UriRoutingContext
getUriRoutingContext()
java.lang.String
getVaryValue()
Get the value of HTTP Vary response header to be set in the response, ornull
if no value is to be set.(package private) java.lang.Iterable<javax.ws.rs.ext.WriterInterceptor>
getWriterInterceptors()
Get all writer interceptors applicable to this request.void
inResponseProcessing()
Notify this request that the response created from this request is already being processed.<T> T
readEntity(java.lang.Class<T> rawType)
Read entity from a context entity input stream.<T> T
readEntity(java.lang.Class<T> rawType, java.lang.annotation.Annotation[] annotations)
Read entity from a context entity input stream.<T> T
readEntity(java.lang.Class<T> rawType, java.lang.reflect.Type type)
Read entity from a context entity input stream.<T> T
readEntity(java.lang.Class<T> rawType, java.lang.reflect.Type type, java.lang.annotation.Annotation[] annotations)
Read entity from a context entity input stream.void
removeProperty(java.lang.String name)
Removes a property with the given name from the current request/response exchange context.private static long
roundDown(long time)
Round down the time to the nearest second.javax.ws.rs.core.Variant
selectVariant(java.util.List<javax.ws.rs.core.Variant> variants)
void
setEntityStream(java.io.InputStream input)
Set a new entity input stream.void
setMethod(java.lang.String method)
void
setMethodWithoutException(java.lang.String method)
LikesetMethod(String)
but does not throwIllegalStateException
if the method is invoked in other than pre-matching phase.(package private) void
setProcessingProviders(ProcessingProviders providers)
void
setProperty(java.lang.String name, java.lang.Object object)
Binds an object to a given property name in the current request/response exchange context.void
setRequestScopedInitializer(RequestScopedInitializer requestScopedInitializer)
Set a custom container extensions initializer for the current request.void
setRequestUri(java.net.URI requestUri)
void
setRequestUri(java.net.URI baseUri, java.net.URI requestUri)
void
setSecurityContext(javax.ws.rs.core.SecurityContext context)
void
setWriter(ContainerResponseWriter responseWriter)
Set the container response writer for the current request.-
Methods inherited from class org.glassfish.jersey.message.internal.InboundMessageContext
bufferEntity, close, getAllowedMethods, getDate, getEntityStream, getEntityTag, getHeaders, getHeaderString, getIfMatch, getIfNoneMatch, getLanguage, getLastModified, getLength, getLink, getLinkBuilder, getLinks, getLocation, getMediaType, getQualifiedAcceptableLanguages, getQualifiedAcceptableMediaTypes, getQualifiedAcceptCharset, getQualifiedAcceptEncoding, getRequestCookies, getResponseCookies, getWorkers, hasEntity, hasLink, header, headers, headers, headers, headers, readEntity, readEntity, readEntity, readEntity, remove, setWorkers
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
-
-
-
Field Detail
-
DEFAULT_BASE_URI
private static final java.net.URI DEFAULT_BASE_URI
-
propertiesDelegate
private final PropertiesDelegate propertiesDelegate
-
uriRoutingContext
private final UriRoutingContext uriRoutingContext
-
baseUri
private java.net.URI baseUri
-
requestUri
private java.net.URI requestUri
-
encodedRelativePath
private java.lang.String encodedRelativePath
-
decodedRelativePath
private java.lang.String decodedRelativePath
-
absolutePathUri
private java.net.URI absolutePathUri
-
httpMethod
private java.lang.String httpMethod
-
securityContext
private javax.ws.rs.core.SecurityContext securityContext
-
abortResponse
private javax.ws.rs.core.Response abortResponse
-
varyValue
private java.lang.String varyValue
-
processingProviders
private ProcessingProviders processingProviders
-
requestScopedInitializer
private RequestScopedInitializer requestScopedInitializer
-
responseWriter
private ContainerResponseWriter responseWriter
-
inResponseProcessingPhase
private boolean inResponseProcessingPhase
-
ERROR_REQUEST_SET_ENTITY_STREAM_IN_RESPONSE_PHASE
private static final java.lang.String ERROR_REQUEST_SET_ENTITY_STREAM_IN_RESPONSE_PHASE
-
ERROR_REQUEST_SET_SECURITY_CONTEXT_IN_RESPONSE_PHASE
private static final java.lang.String ERROR_REQUEST_SET_SECURITY_CONTEXT_IN_RESPONSE_PHASE
-
ERROR_REQUEST_ABORT_IN_RESPONSE_PHASE
private static final java.lang.String ERROR_REQUEST_ABORT_IN_RESPONSE_PHASE
-
METHOD_PARAMETER_CANNOT_BE_NULL_OR_EMPTY
private static final java.lang.String METHOD_PARAMETER_CANNOT_BE_NULL_OR_EMPTY
-
METHOD_PARAMETER_CANNOT_BE_NULL_ETAG
private static final java.lang.String METHOD_PARAMETER_CANNOT_BE_NULL_ETAG
-
METHOD_PARAMETER_CANNOT_BE_NULL_LAST_MODIFIED
private static final java.lang.String METHOD_PARAMETER_CANNOT_BE_NULL_LAST_MODIFIED
-
-
Constructor Detail
-
ContainerRequest
public ContainerRequest(java.net.URI baseUri, java.net.URI requestUri, java.lang.String httpMethod, javax.ws.rs.core.SecurityContext securityContext, PropertiesDelegate propertiesDelegate)
Create new Jersey container request context.- Parameters:
baseUri
- base application URI.requestUri
- request URI.httpMethod
- request HTTP method name.securityContext
- security context of the current request. Must not benull
. TheSecurityContext.getUserPrincipal()
must returnnull
if the current request has not been authenticated by the container.propertiesDelegate
- customproperties delegate
to be used by the context.
-
-
Method Detail
-
getRequestScopedInitializer
public RequestScopedInitializer getRequestScopedInitializer()
Get a custom container extensions initializer for the current request. The initializer is guaranteed to be run from within the request scope of the current request.- Returns:
- custom container extensions initializer or
null
if not available.
-
setRequestScopedInitializer
public void setRequestScopedInitializer(RequestScopedInitializer requestScopedInitializer)
Set a custom container extensions initializer for the current request. The initializer is guaranteed to be run from within the request scope of the current request.- Parameters:
requestScopedInitializer
- custom container extensions initializer.
-
getResponseWriter
public ContainerResponseWriter getResponseWriter()
Get the container response writer for the current request.- Returns:
- container response writer.
-
setWriter
public void setWriter(ContainerResponseWriter responseWriter)
Set the container response writer for the current request.- Parameters:
responseWriter
- container response writer. Must not benull
.
-
readEntity
public <T> T readEntity(java.lang.Class<T> rawType)
Read entity from a context entity input stream.- Type Parameters:
T
- entity Java object type.- Parameters:
rawType
- raw Java entity type.- Returns:
- entity read from a context entity input stream.
-
readEntity
public <T> T readEntity(java.lang.Class<T> rawType, java.lang.annotation.Annotation[] annotations)
Read entity from a context entity input stream.- Type Parameters:
T
- entity Java object type.- Parameters:
rawType
- raw Java entity type.annotations
- entity annotations.- Returns:
- entity read from a context entity input stream.
-
readEntity
public <T> T readEntity(java.lang.Class<T> rawType, java.lang.reflect.Type type)
Read entity from a context entity input stream.- Type Parameters:
T
- entity Java object type.- Parameters:
rawType
- raw Java entity type.type
- generic Java entity type.- Returns:
- entity read from a context entity input stream.
-
readEntity
public <T> T readEntity(java.lang.Class<T> rawType, java.lang.reflect.Type type, java.lang.annotation.Annotation[] annotations)
Read entity from a context entity input stream.- Type Parameters:
T
- entity Java object type.- Parameters:
rawType
- raw Java entity type.type
- generic Java entity type.annotations
- entity annotations.- Returns:
- entity read from a context entity input stream.
-
getProperty
public java.lang.Object getProperty(java.lang.String name)
Description copied from interface:PropertiesDelegate
Returns the property with the given name registered in the current request/response exchange context, ornull
if there is no property by that name.A property allows a JAX-RS filters and interceptors to exchange additional custom information not already provided by this interface.
A list of supported properties can be retrieved using
PropertiesDelegate.getPropertyNames()
. Custom property names should follow the same convention as package names.- Specified by:
getProperty
in interfacejavax.ws.rs.container.ContainerRequestContext
- Specified by:
getProperty
in interfacePropertiesDelegate
- Parameters:
name
- aString
specifying the name of the property.- Returns:
- an
Object
containing the value of the property, ornull
if no property exists matching the given name. - See Also:
PropertiesDelegate.getPropertyNames()
-
getPropertyNames
public java.util.Collection<java.lang.String> getPropertyNames()
Description copied from interface:PropertiesDelegate
Returns an immutablecollection
containing the property names available within the context of the current request/response exchange context.Use the
PropertiesDelegate.getProperty(java.lang.String)
method with a property name to get the value of a property.- Specified by:
getPropertyNames
in interfacejavax.ws.rs.container.ContainerRequestContext
- Specified by:
getPropertyNames
in interfacePropertiesDelegate
- Returns:
- an immutable
collection
of property names. - See Also:
PropertiesDelegate.getProperty(java.lang.String)
-
setProperty
public void setProperty(java.lang.String name, java.lang.Object object)
Description copied from interface:PropertiesDelegate
Binds an object to a given property name in the current request/response exchange context. If the name specified is already used for a property, this method will replace the value of the property with the new value.A property allows a JAX-RS filters and interceptors to exchange additional custom information not already provided by this interface.
A list of supported properties can be retrieved using
PropertiesDelegate.getPropertyNames()
. Custom property names should follow the same convention as package names.If a
null
value is passed, the effect is the same as calling thePropertiesDelegate.removeProperty(String)
method.- Specified by:
setProperty
in interfacejavax.ws.rs.container.ContainerRequestContext
- Specified by:
setProperty
in interfacePropertiesDelegate
- Parameters:
name
- aString
specifying the name of the property.object
- anObject
representing the property to be bound.
-
removeProperty
public void removeProperty(java.lang.String name)
Description copied from interface:PropertiesDelegate
Removes a property with the given name from the current request/response exchange context. After removal, subsequent calls toPropertiesDelegate.getProperty(java.lang.String)
to retrieve the property value will returnnull
.- Specified by:
removeProperty
in interfacejavax.ws.rs.container.ContainerRequestContext
- Specified by:
removeProperty
in interfacePropertiesDelegate
- Parameters:
name
- aString
specifying the name of the property to be removed.
-
getPropertiesDelegate
public PropertiesDelegate getPropertiesDelegate()
Get the underlying properties delegate.- Returns:
- underlying properties delegate.
-
getUriInfo
public ExtendedUriInfo getUriInfo()
- Specified by:
getUriInfo
in interfacejavax.ws.rs.container.ContainerRequestContext
-
setProcessingProviders
void setProcessingProviders(ProcessingProviders providers)
-
getUriRoutingContext
UriRoutingContext getUriRoutingContext()
-
getRequestFilters
java.lang.Iterable<RankedProvider<javax.ws.rs.container.ContainerRequestFilter>> getRequestFilters()
Get all bound request filters applicable to this request.- Returns:
- All bound (dynamically or by name) request filters applicable to the matched inflector (or an empty collection if no inflector matched yet).
-
getResponseFilters
java.lang.Iterable<RankedProvider<javax.ws.rs.container.ContainerResponseFilter>> getResponseFilters()
Get all bound response filters applicable to this request. This is populated once the right resource method is matched.- Returns:
- All bound (dynamically or by name) response filters applicable to the matched inflector (or an empty collection if no inflector matched yet).
-
getReaderInterceptors
protected java.lang.Iterable<javax.ws.rs.ext.ReaderInterceptor> getReaderInterceptors()
Get all reader interceptors applicable to this request. This is populated once the right resource method is matched.- Specified by:
getReaderInterceptors
in classInboundMessageContext
- Returns:
- All reader interceptors applicable to the matched inflector (or an empty collection if no inflector matched yet).
-
getWriterInterceptors
java.lang.Iterable<javax.ws.rs.ext.WriterInterceptor> getWriterInterceptors()
Get all writer interceptors applicable to this request.- Returns:
- All writer interceptors applicable to the matched inflector (or an empty collection if no inflector matched yet).
-
getInflector
private Inflector<RequestProcessingContext,ContainerResponse> getInflector()
-
emptyIfNull
private static <T> java.lang.Iterable<T> emptyIfNull(java.lang.Iterable<T> iterable)
-
getBaseUri
public java.net.URI getBaseUri()
Get base request URI.- Returns:
- base request URI.
-
getRequestUri
public java.net.URI getRequestUri()
Get request URI.- Returns:
- request URI.
-
getAbsolutePath
public java.net.URI getAbsolutePath()
Get the absolute path of the request. This includes everything preceding the path (host, port etc), but excludes query parameters or fragment.- Returns:
- the absolute path of the request.
-
setRequestUri
public void setRequestUri(java.net.URI requestUri) throws java.lang.IllegalStateException
- Specified by:
setRequestUri
in interfacejavax.ws.rs.container.ContainerRequestContext
- Throws:
java.lang.IllegalStateException
-
setRequestUri
public void setRequestUri(java.net.URI baseUri, java.net.URI requestUri) throws java.lang.IllegalStateException
- Specified by:
setRequestUri
in interfacejavax.ws.rs.container.ContainerRequestContext
- Throws:
java.lang.IllegalStateException
-
getPath
public java.lang.String getPath(boolean decode)
Get the path of the current request relative to the application root (base) URI as a string.- Parameters:
decode
- controls whether sequences of escaped octets are decoded (true
) or not (false
).- Returns:
- relative request path.
-
encodedRelativePath
private java.lang.String encodedRelativePath()
-
getMethod
public java.lang.String getMethod()
- Specified by:
getMethod
in interfacejavax.ws.rs.container.ContainerRequestContext
- Specified by:
getMethod
in interfacejavax.ws.rs.core.Request
-
setMethod
public void setMethod(java.lang.String method) throws java.lang.IllegalStateException
- Specified by:
setMethod
in interfacejavax.ws.rs.container.ContainerRequestContext
- Throws:
java.lang.IllegalStateException
-
setMethodWithoutException
public void setMethodWithoutException(java.lang.String method)
LikesetMethod(String)
but does not throwIllegalStateException
if the method is invoked in other than pre-matching phase.- Parameters:
method
- HTTP method.
-
getSecurityContext
public javax.ws.rs.core.SecurityContext getSecurityContext()
- Specified by:
getSecurityContext
in interfacejavax.ws.rs.container.ContainerRequestContext
-
setSecurityContext
public void setSecurityContext(javax.ws.rs.core.SecurityContext context)
- Specified by:
setSecurityContext
in interfacejavax.ws.rs.container.ContainerRequestContext
-
setEntityStream
public void setEntityStream(java.io.InputStream input)
Description copied from class:InboundMessageContext
Set a new entity input stream.- Specified by:
setEntityStream
in interfacejavax.ws.rs.container.ContainerRequestContext
- Overrides:
setEntityStream
in classInboundMessageContext
- Parameters:
input
- new entity input stream.
-
getRequest
public javax.ws.rs.core.Request getRequest()
- Specified by:
getRequest
in interfacejavax.ws.rs.container.ContainerRequestContext
-
abortWith
public void abortWith(javax.ws.rs.core.Response response)
- Specified by:
abortWith
in interfacejavax.ws.rs.container.ContainerRequestContext
-
inResponseProcessing
public void inResponseProcessing()
Notify this request that the response created from this request is already being processed. This means that the request processing phase has finished and this request can be used only in the request processing phase (for example in ContainerResponseFilter). The request can be used for processing of more than one response (in async cases). Then this method should be called when the first response is created from this request. Multiple calls to this method has the same effect as calling the method only once.
-
getAbortResponse
public javax.ws.rs.core.Response getAbortResponse()
Get the request filter chain aborting response if set, ornull
otherwise.- Returns:
- request filter chain aborting response if set, or
null
otherwise.
-
getCookies
public java.util.Map<java.lang.String,javax.ws.rs.core.Cookie> getCookies()
- Specified by:
getCookies
in interfacejavax.ws.rs.container.ContainerRequestContext
- Specified by:
getCookies
in interfacejavax.ws.rs.core.HttpHeaders
-
getAcceptableMediaTypes
public java.util.List<javax.ws.rs.core.MediaType> getAcceptableMediaTypes()
- Specified by:
getAcceptableMediaTypes
in interfacejavax.ws.rs.container.ContainerRequestContext
- Specified by:
getAcceptableMediaTypes
in interfacejavax.ws.rs.core.HttpHeaders
-
getAcceptableLanguages
public java.util.List<java.util.Locale> getAcceptableLanguages()
- Specified by:
getAcceptableLanguages
in interfacejavax.ws.rs.container.ContainerRequestContext
- Specified by:
getAcceptableLanguages
in interfacejavax.ws.rs.core.HttpHeaders
-
selectVariant
public javax.ws.rs.core.Variant selectVariant(java.util.List<javax.ws.rs.core.Variant> variants) throws java.lang.IllegalArgumentException
- Specified by:
selectVariant
in interfacejavax.ws.rs.core.Request
- Throws:
java.lang.IllegalArgumentException
-
getVaryValue
public java.lang.String getVaryValue()
Get the value of HTTP Vary response header to be set in the response, ornull
if no value is to be set.- Returns:
- value of HTTP Vary response header to be set in the response if available,
null
otherwise.
-
evaluatePreconditions
public javax.ws.rs.core.Response.ResponseBuilder evaluatePreconditions(javax.ws.rs.core.EntityTag eTag)
- Specified by:
evaluatePreconditions
in interfacejavax.ws.rs.core.Request
-
evaluatePreconditions
public javax.ws.rs.core.Response.ResponseBuilder evaluatePreconditions(java.util.Date lastModified)
- Specified by:
evaluatePreconditions
in interfacejavax.ws.rs.core.Request
-
evaluatePreconditions
public javax.ws.rs.core.Response.ResponseBuilder evaluatePreconditions(java.util.Date lastModified, javax.ws.rs.core.EntityTag eTag)
- Specified by:
evaluatePreconditions
in interfacejavax.ws.rs.core.Request
-
evaluatePreconditions
public javax.ws.rs.core.Response.ResponseBuilder evaluatePreconditions()
- Specified by:
evaluatePreconditions
in interfacejavax.ws.rs.core.Request
-
evaluateIfMatch
private javax.ws.rs.core.Response.ResponseBuilder evaluateIfMatch(javax.ws.rs.core.EntityTag eTag)
-
evaluateIfNoneMatch
private javax.ws.rs.core.Response.ResponseBuilder evaluateIfNoneMatch(javax.ws.rs.core.EntityTag eTag)
-
evaluateIfNoneMatch
private javax.ws.rs.core.Response.ResponseBuilder evaluateIfNoneMatch(javax.ws.rs.core.EntityTag eTag, java.util.Set<? extends javax.ws.rs.core.EntityTag> matchingTags, boolean isGetOrHead)
-
evaluateIfUnmodifiedSince
private javax.ws.rs.core.Response.ResponseBuilder evaluateIfUnmodifiedSince(long lastModified)
-
evaluateIfModifiedSince
private javax.ws.rs.core.Response.ResponseBuilder evaluateIfModifiedSince(long lastModified)
-
evaluateIfModifiedSince
private javax.ws.rs.core.Response.ResponseBuilder evaluateIfModifiedSince(long lastModified, java.lang.String ifModifiedSinceHeader)
-
roundDown
private static long roundDown(long time)
Round down the time to the nearest second.- Parameters:
time
- the time to round down.- Returns:
- the rounded down time.
-
getRequestHeader
public java.util.List<java.lang.String> getRequestHeader(java.lang.String name)
Get the values of a HTTP request header. The returned List is read-only. This is a shortcut forgetRequestHeaders().get(name)
.- Specified by:
getRequestHeader
in interfacejavax.ws.rs.core.HttpHeaders
- Parameters:
name
- the header name, case insensitive.- Returns:
- a read-only list of header values.
- Throws:
java.lang.IllegalStateException
- if called outside the scope of a request.
-
getRequestHeaders
public javax.ws.rs.core.MultivaluedMap<java.lang.String,java.lang.String> getRequestHeaders()
Get the values of HTTP request headers. The returned Map is case-insensitive wrt. keys and is read-only. The method never returnsnull
.- Specified by:
getRequestHeaders
in interfacejavax.ws.rs.core.HttpHeaders
- Returns:
- a read-only map of header names and values.
- Throws:
java.lang.IllegalStateException
- if called outside the scope of a request.
-
checkState
void checkState() throws java.lang.IllegalStateException
Check if the container request has been properly initialized for processing.- Throws:
java.lang.IllegalStateException
- in case the internal state is not ready for processing.
-
-