An application class should not extend this class directly. Response class is
reserved for an extension by a JAX-RS implementation providers. An application should use one
of the static methods to create a Response instance using a ResponseBuilder.
Several methods have parameters of type URI, UriBuilder provides
convenient methods to create such values as does URI#create(java.lang.String).
Response.ResponseBuilder
| Modifier and Type | Class and Description |
|---|---|
| public abstract static class | Response.ResponseBuilder
A class used to build Response instances that contain metadata instead of or in addition to an entity. |
| public static enum | Response.Status
Commonly used status codes defined by HTTP, see
|
| public static interface | Response.StatusType
Base interface for statuses used in responses. |
| Access | Constructor and Description |
|---|---|
| protected | Response()
Protected constructor, use one of the static methods to obtain a
|
| Modifier and Type | Method and Description |
|---|---|
| public static Response. | |
| public static Response. | |
| public abstract boolean | Returns: true if the message entity input stream was available and
was buffered successfully, returns false if the entity stream
was not available.Buffer the message entity data. |
| public abstract void | close()
Redeclares java. buffered message entity data).
|
| public static Response. | Returns: a new response builder.the URI of the new resource. If a relative URI is
supplied it will be converted into an absolute URI by resolving it
relative to the request URI (see location)UriInfo#getRequestUri).Create a new ResponseBuilder for a created resource, set the location header using the supplied value. |
| public static Response. | Returns: a new response builder.a Response from which the status code, entity and
response)response headers will be copied.Create a new ResponseBuilder by performing a shallow copy of an existing Response. |
| public abstract Set | Returns: the allowed HTTP methods, all methods will returned as upper case strings.Get the allowed HTTP methods from the Allow HTTP header. |
| public abstract Map | Returns: a read-only map of cookie name (String) to Cookie.Get any new cookies set on the response message. |
| public abstract Date | |
| public abstract Object | Returns: the message entity ornull if message does not contain an
entity body (i.e. when hasEntity() returns false).Get the message entity Java instance. |
| public abstract EntityTag | |
| public MultivaluedMap | Returns: response headers as an object view of header values.Get view of the response headers and their object values. |
| public abstract String | Returns: the message header value. If the message header is not present thennull is returned. If the message header is present but has no
value then the empty string is returned. If the message header is present
more than once then the values of joined together and separated by a ','
character.the message header. name)Get a message header as a single string value. |
| public abstract Locale | Returns: the language of the entity or null if not specified.Get the language of the message entity. |
| public abstract Date | Returns: the last modified date, otherwisenull if not present.Get the last modified date. |
| public abstract int | Returns: Content-Length as integer if present and valid number. In other cases returns-1.Get Content-Length value. |
| public abstract Link | |
| public abstract Link. | Returns: the link builder for the relation, otherwisenull if not
present.link relation. relation)Convenience method that returns a |
| public abstract Set | |
| public abstract URI | |
| public abstract MediaType | Returns: the media type ornull if there is no response entity.Get the media type of the message entity. |
| public abstract MultivaluedMap | |
| public abstract int | |
| public abstract Response. | Returns: the response status information. The returned value is nevernull.Get the complete status information associated with the response. |
| public abstract MultivaluedMap | Returns: response headers as a string view of header values.Get view of the response headers and their string values. |
| public abstract boolean | Returns: true if there is an entity present in the message,
false otherwise.Check if there is an entity available in the response. |
| public abstract boolean | |
| public static Response. | |
| public static Response. | Returns: a new response builder.list of variants that were available, a null value is
equivalent to an empty list. variants)Create a new ResponseBuilder for a not acceptable response. |
| public static Response. | Returns: a new response builder.Create a new ResponseBuilder with a not-modified status. |
| public static Response. | Returns: a new response builder.a tag for the unmodified entity. tag)Create a new ResponseBuilder with a not-modified status. |
| public static Response. | Returns: a new response builder.the string content of a strong entity tag. The JAX-RS
runtime will quote the supplied value when creating the
header. tag)Create a new ResponseBuilder with a not-modified status and a strong entity tag. |
| public static Response. | |
| public static Response. | |
| public static Response. | |
| public static Response. | |
| public static Response. | |
| public abstract < entity instance Java type. T> T | Returns: the message entity; for a zero-length response entities returns a corresponding Java object that represents zero-length data. In case no zero-length representation is defined for the Java type, aProcessingException wrapping the
underlying NoContentException is thrown.the type of entity. entityType)Read the message entity input stream as an instance of specified Java type
using a |
| public abstract < entity instance Java type. T> T | Returns: the message entity; for a zero-length response entities returns a corresponding Java object that represents zero-length data. In case no zero-length representation is defined for the Java type, aProcessingException wrapping the
underlying NoContentException is thrown.the type of entity; may be generic. entityType)Read the message entity input stream as an instance of specified Java type
using a |
| public abstract < entity instance Java type. T> T | Returns: the message entity; for a zero-length response entities returns a corresponding Java object that represents zero-length data. In case no zero-length representation is defined for the Java type, aProcessingException wrapping the
underlying NoContentException is thrown.the type of entity. entityType, Annotation[] annotations that will be passed to the annotations)MessageBodyReader.Read the message entity input stream as an instance of specified Java type
using a |
| public abstract < entity instance Java type. T> T | Returns: the message entity; for a zero-length response entities returns a corresponding Java object that represents zero-length data. In case no zero-length representation is defined for the Java type, aProcessingException wrapping the
underlying NoContentException is thrown.the type of entity; may be generic. entityType, Annotation[] annotations that will be passed to the annotations)MessageBodyReader.Read the message entity input stream as an instance of specified Java type
using a |
| public static Response. | Returns: a new response builder.the redirection URI. If a relative URI is
supplied it will be converted into an absolute URI by resolving it
relative to the base URI of the application (see
location)UriInfo#getBaseUri).Create a new ResponseBuilder for a redirection. |
| public static Response. | Returns: a new response builder.Create a new ResponseBuilder with an server error status. |
| public static Response. | Returns: a new response builder.the response status. statusCreate a new ResponseBuilder with the supplied status. |
| public static Response. | |
| public static Response. | Returns: a new response builder.the response status. status)Create a new ResponseBuilder with the supplied status. |
| public static Response. | |
| public static Response. | Returns: a new response builder.the redirection URI. If a relative URI is
supplied it will be converted into an absolute URI by resolving it
relative to the base URI of the application (see
location)UriInfo#getBaseUri).Create a new ResponseBuilder for a temporary redirection. |