com.atlassian.confluence.util.http.httpclient
Class HttpClientHttpResponse

java.lang.Object
  extended by com.atlassian.confluence.util.http.httpclient.HttpClientHttpResponse
All Implemented Interfaces:
HttpResponse

public class HttpClientHttpResponse
extends java.lang.Object
implements HttpResponse


Constructor Summary
HttpClientHttpResponse(HttpRequest httpRequest, org.apache.commons.httpclient.HttpMethod method)
           
 
Method Summary
 void finish()
           
 java.lang.String getCharset()
          Returns the charset of the response.
 java.lang.String getContentType()
          Returns the type of the response content.
 java.lang.String[] getHeaders(java.lang.String name)
          Retrieves all HTTP response headers with the specified name and returns an array of their values.
 java.lang.String getMIMEType()
          Returns the MIME type of the response.
 java.io.InputStream getResponse()
           
 java.net.URI getResponseURI()
          Returns the URI of the site that the response came from.
 int getStatusCode()
           
 java.lang.String getStatusMessage()
           
 boolean isCached()
           
 boolean isFailed()
           
 boolean isNotFound()
           
 boolean isNotPermitted()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

HttpClientHttpResponse

public HttpClientHttpResponse(HttpRequest httpRequest,
                              org.apache.commons.httpclient.HttpMethod method)
Method Detail

getResponseURI

public java.net.URI getResponseURI()
Description copied from interface: HttpResponse
Returns the URI of the site that the response came from. The URI will be absolute if the host configuration has been set and relative otherwise.

Specified by:
getResponseURI in interface HttpResponse
Returns:
the URI of the response

isCached

public boolean isCached()
Specified by:
isCached in interface HttpResponse

isFailed

public boolean isFailed()
Specified by:
isFailed in interface HttpResponse

isNotFound

public boolean isNotFound()
Specified by:
isNotFound in interface HttpResponse

isNotPermitted

public boolean isNotPermitted()
Specified by:
isNotPermitted in interface HttpResponse

getResponse

public java.io.InputStream getResponse()
                                throws java.io.IOException
Specified by:
getResponse in interface HttpResponse
Throws:
java.io.IOException

getContentType

public java.lang.String getContentType()
Description copied from interface: HttpResponse
Returns the type of the response content.

Specified by:
getContentType in interface HttpResponse
Returns:
a string containing the MIME type and the charset of the response.
See Also:
HttpResponse.getCharset(), HttpResponse.getMIMEType()

getCharset

public java.lang.String getCharset()
Description copied from interface: HttpResponse
Returns the charset of the response.

Specified by:
getCharset in interface HttpResponse
Returns:
the charset of the response, or null.

getMIMEType

public java.lang.String getMIMEType()
Description copied from interface: HttpResponse
Returns the MIME type of the response.

Specified by:
getMIMEType in interface HttpResponse
Returns:
the MIME type of the response.

getHeaders

public java.lang.String[] getHeaders(java.lang.String name)
Description copied from interface: HttpResponse
Retrieves all HTTP response headers with the specified name and returns an array of their values.

Specified by:
getHeaders in interface HttpResponse
Parameters:
name - the HTTP response header to retreive. Must not be null, or an IllegalArgumentException will be thrown.
Returns:
an array of the header values found on the response, or an empty array. Must not return null.

getStatusMessage

public java.lang.String getStatusMessage()
Specified by:
getStatusMessage in interface HttpResponse

getStatusCode

public int getStatusCode()
Specified by:
getStatusCode in interface HttpResponse

finish

public void finish()
Specified by:
finish in interface HttpResponse


Copyright © 2003-2013 Atlassian. All Rights Reserved.