net.noderunner.amazon.s3
Class Response

java.lang.Object
  extended by net.noderunner.amazon.s3.Response
Direct Known Subclasses:
GetResponse, GetStreamResponse, ListAllBucketsResponse, ListResponse, LocationResponse

public class Response
extends Object

The parent class of all other Responses.

Returns status codes that should be checked.


Method Summary
 void assertOk()
          Throws an IllegalStateException if not 200-level OK.
 int getContentLength()
          Returns content length of the response.
 String getHeaderField(String field)
          Returns an HTTP header field from the response.
 Headers getHeaders()
          Returns all HTTP headers.
 int getResponseCode()
          Returns the HTTP response code.
 String getResponseMessage()
          Returns the HTTP response message.
 boolean isNotFound()
          Returns true if processing returned 404.
 boolean isOk()
          Returns true if processing was 200-level OK.
protected  void parse(ContentHandler handler)
          Parses the response.
 String toString()
          Returns a string representation.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Method Detail

getResponseCode

public int getResponseCode()
                    throws IOException
Returns the HTTP response code.

Throws:
IOException

getResponseMessage

public String getResponseMessage()
                          throws IOException
Returns the HTTP response message.

Throws:
IOException

getContentLength

public int getContentLength()
Returns content length of the response.


assertOk

public void assertOk()
Throws an IllegalStateException if not 200-level OK.


getHeaderField

public String getHeaderField(String field)
Returns an HTTP header field from the response.


getHeaders

public Headers getHeaders()
Returns all HTTP headers. Prefer caching the return value.


isOk

public boolean isOk()
Returns true if processing was 200-level OK.


isNotFound

public boolean isNotFound()
Returns true if processing returned 404.


toString

public String toString()
Returns a string representation.

Overrides:
toString in class Object

parse

protected void parse(ContentHandler handler)
              throws IOException
Parses the response.

Throws:
IOException


Copyright © 2011. All Rights Reserved.