| Modifier and Type | Method and Description |
|---|---|
| public 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 Map | Returns: a read-only map of cookie name (String) to anew cookie.Get any new cookies set on the response message. |
| public Date | |
| public Object | Returns: the message entity ornull if message does not contain an
entity body.Get the message entity Java instance. |
| public Annotation[] | Returns: annotations attached to the entity instance.Get the annotations attached to the entity instance. |
| public Class | |
| public OutputStream | |
| public EntityTag | |
| public Type | |
| public MultivaluedMap | Returns: mutable multivalued map of response headers.Get the mutable response headers multivalued map. |
| public 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 Locale | Returns: the language of the entity ornull if not specifiedGet the language of the entity. |
| public Date | Returns: the last modified date, otherwisenull if not present.Get the last modified date. |
| public int | Returns: Content-Length as integer if present and valid number. In other cases returns -1.Get Content-Length value. |
| public Link | |
| public Link. | Returns: the link builder for the relation, otherwisenull if not
present.link relation. relation)Convenience method that returns a |
| public Set | |
| public URI | |
| public MediaType | Returns: the media type ornull if not specified (e.g. there's no
response entity).Get the media type of the entity. |
| public int | Returns: the response status code or -1 if the status was not set.Get the status code associated with the response. |
| public Response. | Returns: the response status information ornull if the status was
not set.Get the complete status information associated with the response. |
| public MultivaluedMap | Returns: response headers as a string view of header values.Get a string view of header values associated with the message. |
| public 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 boolean | |
| public void | |
| public void | setEntity(final Object
entity object. entity, final Annotation[] annotations attached to the entity instance. annotations, final MediaType entity media type. mediaType)Set a new message entity, including the attached annotations and the media type. |
| public void | |
| public void | |
| public void | setStatusInfo(Response.
the response status information. statusInfoSet the complete status information (status code and reason phrase) associated with the response. |
| getAllowedMethods | back to summary |
|---|---|
| public Set Get the allowed HTTP methods from the Allow HTTP header. | |
| getCookies | back to summary |
|---|---|
| public Map Get any new cookies set on the response message.
| |
| getDate | back to summary |
|---|---|
| public Date getDate() Get message date.
| |
| getEntity | back to summary |
|---|---|
| public Object getEntity() Get the message entity Java instance.
Returns
| |
| getEntityAnnotations | back to summary |
|---|---|
| public Annotation[] getEntityAnnotations() Get the annotations attached to the entity instance.
Note that the returned annotations array contains only those annotations
explicitly attached to entity instance (such as the ones attached using
Note that container response filters invoked earlier in the filter chain may modify the entity annotations value, in which case this getter method would return the last annotations value set by a container response filter invoked earlier in the filter chain. For example:
@Path("my-resource")
public class MyResource {
private final Annotations[] extras = ... ;
@GET
@Custom
public String getAnnotatedMe() {
return Response.ok().entity("Annotated me", extras).build();
}
...
}
The container response context for a response returned from the Similarly:
@Custom
public class AnnotatedMe { ... }
@Path("my-resource")
public class MyResource {
private final Annotations[] extras = ... ;
@GET
public AnnotatedMe getMe() {
return Response.ok().entity(new AnnotatedMe(), extras).build();
}
...
}
Provided that the value has not been replaced by any container response filter invoked earlier,
the container response context for a response returned from the
| |
| getEntityClass | back to summary |
|---|---|
| public Class Get the raw entity type information.
| |
| getEntityStream | back to summary |
|---|---|
| public OutputStream getEntityStream() Get the entity output stream. The JAX-RS runtime is responsible for closing the output stream.
| |
| getEntityTag | back to summary |
|---|---|
| public EntityTag getEntityTag() Get the entity tag.
| |
| getEntityType | back to summary |
|---|---|
| public Type getEntityType() Get the generic entity type information.
| |
| getHeaders | back to summary |
|---|---|
| public MultivaluedMap Get the mutable response headers multivalued map.
| |
| getHeaderString | back to summary |
|---|---|
| public String getHeaderString(String name) Get a message header as a single string value.
Each single header value is converted to String using a
| |
| getLanguage | back to summary |
|---|---|
| public Locale getLanguage() Get the language of the entity.
| |
| getLastModified | back to summary |
|---|---|
| public Date getLastModified() Get the last modified date.
| |
| getLength | back to summary |
|---|---|
| public int getLength() Get Content-Length value.
| |
| getLink | back to summary |
|---|---|
| public Link getLink(String relation) Get the link for the relation. | |
| getLinkBuilder | back to summary |
|---|---|
| public Link. Convenience method that returns a | |
| getLinks | back to summary |
|---|---|
| public Set Get the links attached to the message as header. | |
| getLocation | back to summary |
|---|---|
| public URI getLocation() Get the location.
| |
| getMediaType | back to summary |
|---|---|
| public MediaType getMediaType() Get the media type of the entity.
| |
| getStatus | back to summary |
|---|---|
| public int getStatus() Get the status code associated with the response.
| |
| getStatusInfo | back to summary |
|---|---|
| public Response. Get the complete status information associated with the response.
| |
| getStringHeaders | back to summary |
|---|---|
| public MultivaluedMap Get a string view of header values associated with the message.
Changes in the underlying
The method converts the non-string header values to strings using a
| |
| hasEntity | back to summary |
|---|---|
| public boolean hasEntity() Check if there is an entity available in the response.
The method returns
| |
| hasLink | back to summary |
|---|---|
| public boolean hasLink(String relation) Check if link for relation exists.
| |
| setEntity | back to summary |
|---|---|
| public void setEntity(final Object entity) Set a new message entity. The existing entity
It is the callers responsibility to wrap the actual entity with
| |
| setEntity | back to summary |
|---|---|
| public void setEntity(final Object entity, final Annotation[] annotations, final MediaType mediaType) Set a new message entity, including the attached annotations and the media type.
It is the callers responsibility to wrap the actual entity with
| |
| setEntityStream | back to summary |
|---|---|
| public void setEntityStream(OutputStream outputStream) Set a new entity output stream. The JAX-RS runtime is responsible for closing the output stream.
| |
| setStatus | back to summary |
|---|---|
| public void setStatus(int code) Set a new response status code.
| |
| setStatusInfo | back to summary |
|---|---|
| public void setStatusInfo(Response. Set the complete status information (status code and reason phrase) associated with the response.
| |