base.connection
Class Response

java.lang.Object
  extended by base.connection.Response
All Implemented Interfaces:
IResponse

public class Response
extends java.lang.Object
implements IResponse


Field Summary
protected  java.util.Map<java.lang.String,java.lang.String> headers
           
protected  IItem item
           
protected  java.lang.String phrase
           
protected  int status
           
protected  org.apache.http.ProtocolVersion version
           
 
Constructor Summary
Response(org.apache.http.HttpResponse response)
          Constructs the Response from an HttpResponse, which is used by HttpClient.
 
Method Summary
 java.lang.String getBody()
          Returns the content of the response as a String.
 java.io.InputStream getBodyStream()
          Returns the raw InputStream of the response.
 java.util.Map<java.lang.String,java.lang.String> getHeaders()
          Returns the headers included in the request's response.
 IItem getItem()
          Returns the response's content as an Item.
 java.lang.String getPhrase()
          Indicates the phrase of the response status.
 int getStatus()
          Indicates the status of the request (e.g.
 org.apache.http.ProtocolVersion getVersion()
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

status

protected int status

phrase

protected java.lang.String phrase

item

protected IItem item

version

protected org.apache.http.ProtocolVersion version

headers

protected java.util.Map<java.lang.String,java.lang.String> headers
Constructor Detail

Response

public Response(org.apache.http.HttpResponse response)
Constructs the Response from an HttpResponse, which is used by HttpClient.

Parameters:
response - is the HttpResponse object returned from HttpClient.
Method Detail

getBody

public java.lang.String getBody()
Description copied from interface: IResponse
Returns the content of the response as a String.

Specified by:
getBody in interface IResponse
Returns:
String is the body of the response interpreted as a String

getBodyStream

public java.io.InputStream getBodyStream()
Description copied from interface: IResponse
Returns the raw InputStream of the response.

Specified by:
getBodyStream in interface IResponse
Returns:
InputStream is a stream of bytes composing the response content

getItem

public IItem getItem()
Description copied from interface: IResponse
Returns the response's content as an Item.

Specified by:
getItem in interface IResponse
Returns:
IItem is the response's content as an Item

getVersion

public org.apache.http.ProtocolVersion getVersion()

getPhrase

public java.lang.String getPhrase()
Description copied from interface: IResponse
Indicates the phrase of the response status.

Specified by:
getPhrase in interface IResponse
Returns:
String is the phrase corresponding with the status

getHeaders

public java.util.Map<java.lang.String,java.lang.String> getHeaders()
Description copied from interface: IResponse
Returns the headers included in the request's response.

Specified by:
getHeaders in interface IResponse
Returns:
Map are the respone's headers

getStatus

public int getStatus()
Description copied from interface: IResponse
Indicates the status of the request (e.g. 200)

Specified by:
getStatus in interface IResponse

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object