Spring for Android

org.springframework.web.client
Class UnknownHttpStatusCodeException

java.lang.Object
  extended by java.lang.Throwable
      extended by java.lang.Exception
          extended by java.lang.RuntimeException
              extended by org.springframework.core.NestedRuntimeException
                  extended by org.springframework.web.client.RestClientException
                      extended by org.springframework.web.client.UnknownHttpStatusCodeException
All Implemented Interfaces:
java.io.Serializable

public class UnknownHttpStatusCodeException
extends RestClientException

Exception thrown when an unknown (or custom) HTTP status code is received.

Since:
2.0
Author:
Rossen Stoyanchev
See Also:
Serialized Form

Constructor Summary
UnknownHttpStatusCodeException(int rawStatusCode, java.lang.String statusText, HttpHeaders responseHeaders, byte[] responseBody, java.nio.charset.Charset responseCharset)
          Construct a new instance of HttpStatusCodeException based on an HttpStatus, status text, and response body content.
 
Method Summary
 int getRawStatusCode()
          Return the raw HTTP status code value.
 byte[] getResponseBodyAsByteArray()
          Return the response body as a byte array.
 java.lang.String getResponseBodyAsString()
          Return the response body as a string.
 HttpHeaders getResponseHeaders()
          Return the HTTP response headers.
 java.lang.String getStatusText()
          Return the HTTP status text.
 
Methods inherited from class org.springframework.core.NestedRuntimeException
contains, getMessage, getMostSpecificCause, getRootCause
 
Methods inherited from class java.lang.Throwable
fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

UnknownHttpStatusCodeException

public UnknownHttpStatusCodeException(int rawStatusCode,
                                      java.lang.String statusText,
                                      HttpHeaders responseHeaders,
                                      byte[] responseBody,
                                      java.nio.charset.Charset responseCharset)
Construct a new instance of HttpStatusCodeException based on an HttpStatus, status text, and response body content.

Parameters:
rawStatusCode - the raw status code value
statusText - the status text
responseHeaders - the response headers, may be null
responseBody - the response body content, may be null
responseCharset - the response body charset, may be null
Method Detail

getRawStatusCode

public int getRawStatusCode()
Return the raw HTTP status code value.


getStatusText

public java.lang.String getStatusText()
Return the HTTP status text.


getResponseHeaders

public HttpHeaders getResponseHeaders()
Return the HTTP response headers.


getResponseBodyAsByteArray

public byte[] getResponseBodyAsByteArray()
Return the response body as a byte array.


getResponseBodyAsString

public java.lang.String getResponseBodyAsString()
Return the response body as a string.


Spring for Android