| Modifier and Type | Class and Description |
|---|---|
static class |
DefaultResponse.DefaultResponseBuilder |
Response.Builder| Constructor and Description |
|---|
DefaultResponse(Headers headers,
InputStream entityStream,
com.atlassian.fugue.Option<Long> maxEntitySize,
int statusCode,
String statusText) |
| Modifier and Type | Method and Description |
|---|---|
static DefaultResponse.DefaultResponseBuilder |
builder() |
String |
getAccept() |
String |
getContentCharset()
Returns the currently set content charset value, if any.
|
com.atlassian.fugue.Option<Long> |
getContentLength()
Returns the content length for the entity in the message.
|
String |
getContentType()
Returns the IANA media type, minus charset information, for the current entity, if any.
|
String |
getEntity()
Returns the current entity in
String form, if available, converting the underlying
entity stream to a string using the currently set content charset, or defaulting to the HTTP
standard of "ISO-8859-1" if no content charset has been specified. |
InputStream |
getEntityStream()
Returns the current entity as an input stream, or null if not set.
|
String |
getHeader(String name)
Returns the specified header by name.
|
Map<String,String> |
getHeaders()
Returns a map of all headers that have been set on this object.
|
int |
getStatusCode()
Gets the status code of the response.
|
String |
getStatusText()
Gets the status text of the response.
|
boolean |
hasEntity()
Returns whether or not an entity has been set on this object.
|
boolean |
hasReadEntity()
Returns whether or not the current entity property, if any, has been read from this object.
|
boolean |
isBadRequest()
Indicates whether or not this response's status code is "Bad Request".
|
boolean |
isClientError()
Indicates whether or not this response's status code is categorized as "Client Error" (4xx).
|
boolean |
isConflict()
Indicates whether or not this response's status code is "Conflict".
|
boolean |
isCreated()
Indicates whether or not this response's status code is "Created".
|
boolean |
isError()
Indicates whether or not this response's status code is categorized as either "Client Error"
or "Server Error".
|
boolean |
isForbidden()
Indicates whether or not this response's status code is "Forbidden".
|
boolean |
isInformational()
Indicates whether or not this response's status code is categorized as "Informational" (1xx).
|
boolean |
isInternalServerError()
Indicates whether or not this response's status code is "Internal Server Error".
|
boolean |
isNoContent()
Indicates whether or not this response's status code is "No Content".
|
boolean |
isNotFound()
Indicates whether or not this response's status code is "Not Found".
|
boolean |
isNotModified()
Indicates whether or not this response's status code is "Not Modified".
|
boolean |
isNotSuccessful()
Indicates whether or not this response's status code is categorized as one of "Informational",
"Redirection", "Client Error" or "Server Error".
|
boolean |
isOk()
Indicates whether or not this response's status code is "OK".
|
boolean |
isRedirection()
Indicates whether or not this response's status code is categorized as "Redirection" (3xx).
|
boolean |
isSeeOther()
Indicates whether or not this response's status code is "See Other".
|
boolean |
isServerError()
Indicates whether or not this response's status code is categorized as "Server Error" (5xx).
|
boolean |
isServiceUnavailable()
Indicates whether or not this response's status code is "Service Unavailable".
|
boolean |
isSuccessful()
Indicates whether or not this response's status code is categorized as "Successful" (2xx).
|
boolean |
isUnauthorized()
Indicates whether or not this response's status code is "Unauthorized".
|
Message |
validate() |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetContentCharset, getContentType, getEntity, getEntityStream, getHeader, getHeaders, hasEntity, hasReadEntitypublic DefaultResponse(Headers headers, InputStream entityStream, com.atlassian.fugue.Option<Long> maxEntitySize, int statusCode, String statusText)
public static DefaultResponse.DefaultResponseBuilder builder()
public int getStatusCode()
ResponsegetStatusCode in interface Responsepublic String getStatusText()
ResponsegetStatusText in interface Responsepublic boolean isInformational()
ResponseisInformational in interface Responsepublic boolean isSuccessful()
ResponseisSuccessful in interface Responsepublic boolean isOk()
Responsepublic boolean isCreated()
Responsepublic boolean isNoContent()
ResponseisNoContent in interface Responsepublic boolean isRedirection()
ResponseisRedirection in interface Responsepublic boolean isSeeOther()
ResponseisSeeOther in interface Responsepublic boolean isNotModified()
ResponseisNotModified in interface Responsepublic boolean isClientError()
ResponseisClientError in interface Responsepublic boolean isBadRequest()
ResponseisBadRequest in interface Responsepublic boolean isUnauthorized()
ResponseisUnauthorized in interface Responsepublic boolean isForbidden()
ResponseisForbidden in interface Responsepublic boolean isNotFound()
ResponseisNotFound in interface Responsepublic boolean isConflict()
ResponseisConflict in interface Responsepublic boolean isServerError()
ResponseisServerError in interface Responsepublic boolean isInternalServerError()
ResponseisInternalServerError in interface Responsepublic boolean isServiceUnavailable()
ResponseisServiceUnavailable in interface Responsepublic boolean isError()
Responsepublic boolean isNotSuccessful()
ResponseisNotSuccessful in interface Responsepublic com.atlassian.fugue.Option<Long> getContentLength()
MessagegetContentLength in interface Messagepublic String getContentType()
MessagegetContentCharset(). To get the full
Content-Type header value including charset if specified, use getHeader("Content-Type").getContentType in interface Messagepublic String getContentCharset()
MessagegetContentCharset in interface Messagepublic String getAccept()
public InputStream getEntityStream() throws IllegalStateException
MessagehasEntity()
to check if this message has an entity value.getEntityStream in interface MessageIllegalStateException - If the non-null entity has already been accessed once, through
any accessor for this objectpublic String getEntity() throws IllegalStateException, IllegalArgumentException
MessageString form, if available, converting the underlying
entity stream to a string using the currently set content charset, or defaulting to the HTTP
standard of "ISO-8859-1" if no content charset has been specified.getEntity in interface MessageIllegalStateException - If the non-null entity has already been accessed once, through
any accessor for this object. Also thrown if underlying body cannot be converted into a StringIllegalArgumentException - If the entity exceeds the maximum sizepublic boolean hasEntity()
MessagehasReadEntity() state.public boolean hasReadEntity()
MessageIllegalStateException being thrown.hasReadEntity in interface Messagepublic Map<String,String> getHeaders()
MessagegetHeaders in interface Messagepublic String getHeader(String name)
Messagepublic Message validate()
Copyright © 2012–2018 Atlassian. All rights reserved.