Class DefaultResponse
- java.lang.Object
-
- com.atlassian.httpclient.apache.httpcomponents.DefaultResponse
-
- All Implemented Interfaces:
com.atlassian.httpclient.api.Message
,com.atlassian.httpclient.api.Response
public final class DefaultResponse extends Object implements com.atlassian.httpclient.api.Response
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
DefaultResponse.DefaultResponseBuilder
-
Constructor Summary
Constructors Constructor Description DefaultResponse(Headers headers, InputStream entityStream, io.atlassian.fugue.Option<Long> maxEntitySize, int statusCode, String statusText)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static DefaultResponse.DefaultResponseBuilder
builder()
String
getAccept()
String
getContentCharset()
io.atlassian.fugue.Option<Long>
getContentLength()
String
getContentType()
String
getEntity()
InputStream
getEntityStream()
String
getHeader(String name)
Map<String,String>
getHeaders()
int
getStatusCode()
String
getStatusText()
boolean
hasEntity()
boolean
hasReadEntity()
boolean
isBadRequest()
boolean
isClientError()
boolean
isConflict()
boolean
isCreated()
boolean
isError()
boolean
isForbidden()
boolean
isInformational()
boolean
isInternalServerError()
boolean
isNoContent()
boolean
isNotFound()
boolean
isNotModified()
boolean
isNotSuccessful()
boolean
isOk()
boolean
isRedirection()
boolean
isSeeOther()
boolean
isServerError()
boolean
isServiceUnavailable()
boolean
isSuccessful()
boolean
isUnauthorized()
com.atlassian.httpclient.api.Message
validate()
-
-
-
Constructor Detail
-
DefaultResponse
public DefaultResponse(Headers headers, InputStream entityStream, io.atlassian.fugue.Option<Long> maxEntitySize, int statusCode, String statusText)
-
-
Method Detail
-
builder
public static DefaultResponse.DefaultResponseBuilder builder()
-
getStatusCode
public int getStatusCode()
- Specified by:
getStatusCode
in interfacecom.atlassian.httpclient.api.Response
-
getStatusText
public String getStatusText()
- Specified by:
getStatusText
in interfacecom.atlassian.httpclient.api.Response
-
isInformational
public boolean isInformational()
- Specified by:
isInformational
in interfacecom.atlassian.httpclient.api.Response
-
isSuccessful
public boolean isSuccessful()
- Specified by:
isSuccessful
in interfacecom.atlassian.httpclient.api.Response
-
isOk
public boolean isOk()
- Specified by:
isOk
in interfacecom.atlassian.httpclient.api.Response
-
isCreated
public boolean isCreated()
- Specified by:
isCreated
in interfacecom.atlassian.httpclient.api.Response
-
isNoContent
public boolean isNoContent()
- Specified by:
isNoContent
in interfacecom.atlassian.httpclient.api.Response
-
isRedirection
public boolean isRedirection()
- Specified by:
isRedirection
in interfacecom.atlassian.httpclient.api.Response
-
isSeeOther
public boolean isSeeOther()
- Specified by:
isSeeOther
in interfacecom.atlassian.httpclient.api.Response
-
isNotModified
public boolean isNotModified()
- Specified by:
isNotModified
in interfacecom.atlassian.httpclient.api.Response
-
isClientError
public boolean isClientError()
- Specified by:
isClientError
in interfacecom.atlassian.httpclient.api.Response
-
isBadRequest
public boolean isBadRequest()
- Specified by:
isBadRequest
in interfacecom.atlassian.httpclient.api.Response
-
isUnauthorized
public boolean isUnauthorized()
- Specified by:
isUnauthorized
in interfacecom.atlassian.httpclient.api.Response
-
isForbidden
public boolean isForbidden()
- Specified by:
isForbidden
in interfacecom.atlassian.httpclient.api.Response
-
isNotFound
public boolean isNotFound()
- Specified by:
isNotFound
in interfacecom.atlassian.httpclient.api.Response
-
isConflict
public boolean isConflict()
- Specified by:
isConflict
in interfacecom.atlassian.httpclient.api.Response
-
isServerError
public boolean isServerError()
- Specified by:
isServerError
in interfacecom.atlassian.httpclient.api.Response
-
isInternalServerError
public boolean isInternalServerError()
- Specified by:
isInternalServerError
in interfacecom.atlassian.httpclient.api.Response
-
isServiceUnavailable
public boolean isServiceUnavailable()
- Specified by:
isServiceUnavailable
in interfacecom.atlassian.httpclient.api.Response
-
isError
public boolean isError()
- Specified by:
isError
in interfacecom.atlassian.httpclient.api.Response
-
isNotSuccessful
public boolean isNotSuccessful()
- Specified by:
isNotSuccessful
in interfacecom.atlassian.httpclient.api.Response
-
getContentLength
public io.atlassian.fugue.Option<Long> getContentLength()
- Specified by:
getContentLength
in interfacecom.atlassian.httpclient.api.Message
-
getContentType
public String getContentType()
- Specified by:
getContentType
in interfacecom.atlassian.httpclient.api.Message
-
getContentCharset
public String getContentCharset()
- Specified by:
getContentCharset
in interfacecom.atlassian.httpclient.api.Message
-
getAccept
public String getAccept()
-
getEntityStream
public InputStream getEntityStream() throws IllegalStateException
- Specified by:
getEntityStream
in interfacecom.atlassian.httpclient.api.Message
- Throws:
IllegalStateException
-
getEntity
public String getEntity() throws IllegalStateException, IllegalArgumentException
- Specified by:
getEntity
in interfacecom.atlassian.httpclient.api.Message
- Throws:
IllegalStateException
IllegalArgumentException
-
hasEntity
public boolean hasEntity()
- Specified by:
hasEntity
in interfacecom.atlassian.httpclient.api.Message
-
hasReadEntity
public boolean hasReadEntity()
- Specified by:
hasReadEntity
in interfacecom.atlassian.httpclient.api.Message
-
getHeaders
public Map<String,String> getHeaders()
- Specified by:
getHeaders
in interfacecom.atlassian.httpclient.api.Message
-
getHeader
public String getHeader(String name)
- Specified by:
getHeader
in interfacecom.atlassian.httpclient.api.Message
-
validate
public com.atlassian.httpclient.api.Message validate()
-
-