com.atlassian.httpclient.apache.httpcomponents
Class DefaultResponse

java.lang.Object
  extended by com.atlassian.httpclient.apache.httpcomponents.DefaultResponse
All Implemented Interfaces:
Message, Response

public final class DefaultResponse
extends java.lang.Object
implements Response


Constructor Summary
DefaultResponse(long maxEntitySize)
           
 
Method Summary
protected  void checkMutable()
           
protected  Response freeze()
           
 java.lang.String getContentCharset()
           
 java.lang.String getContentType()
           
 java.lang.String getEntity()
           
 java.io.InputStream getEntityStream()
           
 java.lang.String getHeader(java.lang.String name)
           
 java.util.Map<java.lang.String,java.lang.String> getHeaders()
           
 int getStatusCode()
           
 java.lang.String getStatusText()
           
 boolean hasEntity()
           
 boolean hasReadEntity()
           
 boolean isBadRequest()
           
 boolean isClientError()
           
 boolean isConflict()
           
 boolean isCreated()
           
 boolean isError()
           
 boolean isForbidden()
           
 boolean isFrozen()
           
 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()
           
 Response setContentCharset(java.lang.String contentCharset)
           
 Response setContentType(java.lang.String contentType)
           
 Response setEntity(java.lang.String entity)
           
 Response setEntityStream(java.io.InputStream entityStream)
           
 Response setEntityStream(java.io.InputStream entityStream, java.lang.String encoding)
           
 Response setHeader(java.lang.String name, java.lang.String value)
           
 Response setHeaders(java.util.Map<java.lang.String,java.lang.String> headers)
           
 Response setStatusCode(int statusCode)
           
 Response setStatusText(java.lang.String statusText)
           
 Message validate()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.atlassian.httpclient.api.Message
getContentCharset, getContentType, getEntity, getEntityStream, getHeader, getHeaders, hasEntity, hasReadEntity, isFrozen
 

Constructor Detail

DefaultResponse

public DefaultResponse(long maxEntitySize)
Method Detail

getStatusCode

public int getStatusCode()
Specified by:
getStatusCode in interface Response

setStatusCode

public Response setStatusCode(int statusCode)
Specified by:
setStatusCode in interface Response

getStatusText

public java.lang.String getStatusText()
Specified by:
getStatusText in interface Response

setStatusText

public Response setStatusText(java.lang.String statusText)
Specified by:
setStatusText in interface Response

isInformational

public boolean isInformational()
Specified by:
isInformational in interface Response

isSuccessful

public boolean isSuccessful()
Specified by:
isSuccessful in interface Response

isOk

public boolean isOk()
Specified by:
isOk in interface Response

isCreated

public boolean isCreated()
Specified by:
isCreated in interface Response

isNoContent

public boolean isNoContent()
Specified by:
isNoContent in interface Response

isRedirection

public boolean isRedirection()
Specified by:
isRedirection in interface Response

isSeeOther

public boolean isSeeOther()
Specified by:
isSeeOther in interface Response

isNotModified

public boolean isNotModified()
Specified by:
isNotModified in interface Response

isClientError

public boolean isClientError()
Specified by:
isClientError in interface Response

isBadRequest

public boolean isBadRequest()
Specified by:
isBadRequest in interface Response

isUnauthorized

public boolean isUnauthorized()
Specified by:
isUnauthorized in interface Response

isForbidden

public boolean isForbidden()
Specified by:
isForbidden in interface Response

isNotFound

public boolean isNotFound()
Specified by:
isNotFound in interface Response

isConflict

public boolean isConflict()
Specified by:
isConflict in interface Response

isServerError

public boolean isServerError()
Specified by:
isServerError in interface Response

isInternalServerError

public boolean isInternalServerError()
Specified by:
isInternalServerError in interface Response

isServiceUnavailable

public boolean isServiceUnavailable()
Specified by:
isServiceUnavailable in interface Response

isError

public boolean isError()
Specified by:
isError in interface Response

isNotSuccessful

public boolean isNotSuccessful()
Specified by:
isNotSuccessful in interface Response

setContentType

public Response setContentType(java.lang.String contentType)
Specified by:
setContentType in interface Message
Specified by:
setContentType in interface Response

setContentCharset

public Response setContentCharset(java.lang.String contentCharset)
Specified by:
setContentCharset in interface Message
Specified by:
setContentCharset in interface Response

setHeaders

public Response setHeaders(java.util.Map<java.lang.String,java.lang.String> headers)
Specified by:
setHeaders in interface Message
Specified by:
setHeaders in interface Response

setHeader

public Response setHeader(java.lang.String name,
                          java.lang.String value)
Specified by:
setHeader in interface Message
Specified by:
setHeader in interface Response

setEntity

public Response setEntity(java.lang.String entity)
Specified by:
setEntity in interface Message
Specified by:
setEntity in interface Response

setEntityStream

public Response setEntityStream(java.io.InputStream entityStream,
                                java.lang.String encoding)
Specified by:
setEntityStream in interface Message
Specified by:
setEntityStream in interface Response

setEntityStream

public Response setEntityStream(java.io.InputStream entityStream)
Specified by:
setEntityStream in interface Message
Specified by:
setEntityStream in interface Response

freeze

protected Response freeze()

getContentType

public java.lang.String getContentType()
Specified by:
getContentType in interface Message

getContentCharset

public java.lang.String getContentCharset()
Specified by:
getContentCharset in interface Message

getEntityStream

public java.io.InputStream getEntityStream()
                                    throws java.lang.IllegalStateException
Specified by:
getEntityStream in interface Message
Throws:
java.lang.IllegalStateException

getEntity

public java.lang.String getEntity()
                           throws java.lang.IllegalStateException,
                                  java.lang.IllegalArgumentException
Specified by:
getEntity in interface Message
Throws:
java.lang.IllegalStateException
java.lang.IllegalArgumentException

hasEntity

public boolean hasEntity()
Specified by:
hasEntity in interface Message

hasReadEntity

public boolean hasReadEntity()
Specified by:
hasReadEntity in interface Message

getHeaders

public java.util.Map<java.lang.String,java.lang.String> getHeaders()
Specified by:
getHeaders in interface Message

getHeader

public java.lang.String getHeader(java.lang.String name)
Specified by:
getHeader in interface Message

validate

public Message validate()

isFrozen

public boolean isFrozen()
Specified by:
isFrozen in interface Message

checkMutable

protected void checkMutable()


Copyright © 2012 Atlassian. All Rights Reserved.