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 java.lang.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.
 java.lang.String getHeaderField(java.lang.String field)
          Returns an HTTP header field from the response.
 Headers getHeaders()
          Returns all HTTP headers.
 int getResponseCode()
          Returns the HTTP response code.
 java.lang.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(org.xml.sax.ContentHandler handler)
          Parses the response.
 java.lang.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 java.io.IOException
Returns the HTTP response code.

Throws:
java.io.IOException

getResponseMessage

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

Throws:
java.io.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 java.lang.String getHeaderField(java.lang.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 java.lang.String toString()
Returns a string representation.

Overrides:
toString in class java.lang.Object

parse

protected void parse(org.xml.sax.ContentHandler handler)
              throws java.io.IOException
Parses the response.

Throws:
java.io.IOException


Copyright © 2010. All Rights Reserved.