edu.wisc.my.webproxy.beans.http
Class ResponseImpl

java.lang.Object
  extended by edu.wisc.my.webproxy.beans.http.ResponseImpl
All Implemented Interfaces:
Response

public class ResponseImpl
extends Object
implements Response

This class is the implementation of the methods defined in the (@link edu.wisc.my.webproxy.beans.http.Response) interface

Version:
$Id: ResponseImpl.java 20993 2010-07-02 19:32:47Z edalquist $
Author:
nramzan

Field Summary
 
Fields inherited from interface edu.wisc.my.webproxy.beans.http.Response
SC_MOVED_PERMANENTLY, SC_MOVED_TEMPORARILY, SC_SEE_OTHER, SC_TEMPORARY_REDIRECT
 
Constructor Summary
ResponseImpl(org.apache.http.client.methods.HttpUriRequest method, org.apache.http.client.HttpClient client)
          Creates a response object
 
Method Summary
 void close()
          Releases the HTTP connection made to the remote server
 String getContentType()
          Retrieves the type of the content of response as a String
 IHeader[] getHeaders()
          Retrieves all the response headers as an array of Headers
 String getRequestUrl()
           
 InputStream getResponseBodyAsStream()
          Retrieves the body of the response as an inputstream.
 int getStatusCode()
          Retrieves the status code that is returned when a request is made
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ResponseImpl

public ResponseImpl(org.apache.http.client.methods.HttpUriRequest method,
                    org.apache.http.client.HttpClient client)
             throws HttpTimeoutException,
                    IOException
Creates a response object

Parameters:
method - the HttpUriRequest used to make the remote request
client - the HttpClient client instance that made the request
Throws:
HttpTimeoutException
IOException
Method Detail

getResponseBodyAsStream

public InputStream getResponseBodyAsStream()
Description copied from interface: Response
Retrieves the body of the response as an inputstream.

Specified by:
getResponseBodyAsStream in interface Response
Returns:
is the (@link InputStream) the whole body of the response as a InputStream.

getContentType

public String getContentType()
Description copied from interface: Response
Retrieves the type of the content of response as a String

Specified by:
getContentType in interface Response
Returns:
contentType the content type of the response as a String.

getHeaders

public IHeader[] getHeaders()
Description copied from interface: Response
Retrieves all the response headers as an array of Headers

Specified by:
getHeaders in interface Response
Returns:
headers an array of response headers.

getStatusCode

public int getStatusCode()
Description copied from interface: Response
Retrieves the status code that is returned when a request is made

Specified by:
getStatusCode in interface Response
Returns:
statusCode a numeric number as an int representing the status code

getRequestUrl

public String getRequestUrl()
Specified by:
getRequestUrl in interface Response

close

public void close()
Description copied from interface: Response
Releases the HTTP connection made to the remote server

Specified by:
close in interface Response


Copyright © 2010 Jasig. All Rights Reserved.