OpenAPI 1.0

com.aquafold.openapi.net
Interface AQWebResponse


public interface AQWebResponse

The AQWebResponse interface maintains the data returned from a successfully processed AQWebRequest via the AQWebClient interface.

The status of a submitted request can be checked by one of these methods:

The response headers can be retrieved via one the following methods:

The entire response body can be retrieved by calling one of these methods:

The response body can also be saved to a file by calling the saveContent(String fileName) method.


Method Summary
 String getAcceptRangesHeader()
          Returns the value of the Accept-Ranges response header.
 String getAgeHeader()
          Returns the value of the Age response header.
 String getAllowHeader()
          Returns the value of the Allow entity header.
 String getCacheControlHeader()
          Returns the value of the Cache-Control general header.
 String getConnectionHeader()
          Returns the value of the Connection general header.
 Object getContent()
          Returns the response body as an object.
 byte[] getContentBytes()
          Returns the response body as an array of bytes.
 String getContentEncodingHeader()
          Returns the value of the Content-Encoding entity header.
 String getContentLanguageHeader()
          Returns the value of the Content-Language entity header.
 int getContentLengthHeader()
          Returns the value of the Content-Length entity header.
 String getContentLocationHeader()
          Returns the value of the Content-Location entity header.
 String getContentMD5Header()
          Returns the value of the Content-MD5 entity header.
 String getContentRangeHeader()
          Returns the value of the Content-Range entity header.
 String getContentString()
          Returns the response body as a string.
 String getContentTypeHeader()
          Returns the value of the Content-Type entity header.
 String getDateHeader()
          Returns the value of the Date general header.
 String getETagHeader()
          Returns the value of the ETag response header.
 String getExpiresHeader()
          Returns the value of the Expires entity header.
 String getHeaderField(String name)
          Returns the header value associated with the given header name.
 List<String> getHeaderFields(String name)
          Returns the header values associated with the given header name.
 Map<String,List<String>> getHeaderMap()
          Returns all of headers this response currently has.
 String getLastModifiedHeader()
          Returns the value of the Last-Modified entity header.
 String getLocationHeader()
          Returns the value of the Location response header.
 String getPragmaHeader()
          Returns the value of the Pragma general header.
 String getProxyAuthenticateHeader()
          Returns the value of the Proxy-Authenticate response header.
 AQWebRequest getRequest()
          Returns the request object that produces this response.
 String getRetryAfterHeader()
          Returns the value of the Retry-After response header.
 String getServerHeader()
          Returns the value of the Server response header.
 int getStatusCode()
          Returns the response status code.
 String getStatusLine()
          Returns the response status line.
 String getStatusText()
          Returns the response status text.
 String getTrailerHeader()
          Returns the value of the Trailer general header.
 String getTransferEncodingHeader()
          Returns the value of the Transfer-Encoding general header.
 String getUpgradeHeader()
          Returns the value of the Upgrade general header.
 String getVaryHeader()
          Returns the value of the Vary response header.
 String getViaHeader()
          Returns the value of the Via general header.
 String getWarningHeader()
          Returns the value of the Warning general header.
 String getWWWAuthenticateHeader()
          Returns the value of the WWW-Authenticate response header.
 void saveContent(String fileName)
          Saves the response body to a file.
 String toString(boolean showDetail)
          Returns a string representation of this object.
 

Method Detail

getRequest

AQWebRequest getRequest()
Returns the request object that produces this response.

Returns:
the request object that produces this response.

getStatusCode

int getStatusCode()
Returns the response status code.

Returns:
the response status code

getStatusText

String getStatusText()
Returns the response status text.

Returns:
the response status text

getStatusLine

String getStatusLine()
Returns the response status line.

Returns:
the response status line

getContent

Object getContent()
Returns the response body as an object.

Returns:
the response body

getContentString

String getContentString()
Returns the response body as a string.

Returns:
the response body

getContentBytes

byte[] getContentBytes()
Returns the response body as an array of bytes.

Returns:
the response body

saveContent

void saveContent(String fileName)
                 throws Exception
Saves the response body to a file.

Parameters:
fileName - the name of the file where response body to be saved
Throws:
Exception - if fileName is null or cannot be accessed

getHeaderMap

Map<String,List<String>> getHeaderMap()
Returns all of headers this response currently has. The key of the map entry is the header name and corresponding entry value is a list of possible header values.

Returns:
a map containing all of response headers

getHeaderFields

List<String> getHeaderFields(String name)
Returns the header values associated with the given header name.

Parameters:
name - the name of the header
Returns:
a list of zero or more values

getHeaderField

String getHeaderField(String name)
Returns the header value associated with the given header name. If multiple values are found, only the last value is returned.

Parameters:
name - the name of the header
Returns:
the header value or null if header name is not defined

getCacheControlHeader

String getCacheControlHeader()
Returns the value of the Cache-Control general header.

Returns:
the header value or null if the Cache-Control header is not defined

getConnectionHeader

String getConnectionHeader()
Returns the value of the Connection general header.

Returns:
the header value or null if the Connection header is not defined

getDateHeader

String getDateHeader()
Returns the value of the Date general header.

Returns:
the header value or null if the Date header is not defined

getPragmaHeader

String getPragmaHeader()
Returns the value of the Pragma general header.

Returns:
the header value or null if the Pragma header is not defined

getTrailerHeader

String getTrailerHeader()
Returns the value of the Trailer general header.

Returns:
the header value or null if the Trailer header is not defined

getTransferEncodingHeader

String getTransferEncodingHeader()
Returns the value of the Transfer-Encoding general header.

Returns:
the header value or null if the Transfer-Encoding header is not defined

getUpgradeHeader

String getUpgradeHeader()
Returns the value of the Upgrade general header.

Returns:
the header value or null if the Upgrade header is not defined

getViaHeader

String getViaHeader()
Returns the value of the Via general header.

Returns:
the header value or null if the Via header is not defined

getWarningHeader

String getWarningHeader()
Returns the value of the Warning general header.

Returns:
the header value or null if the Warning header is not defined

getAllowHeader

String getAllowHeader()
Returns the value of the Allow entity header.

Returns:
the header value or null if the Allow header is not defined

getContentEncodingHeader

String getContentEncodingHeader()
Returns the value of the Content-Encoding entity header.

Returns:
the header value or null if the Content-Encoding header is not defined

getContentLanguageHeader

String getContentLanguageHeader()
Returns the value of the Content-Language entity header.

Returns:
the header value or null if the Content-Language header is not defined

getContentLengthHeader

int getContentLengthHeader()
Returns the value of the Content-Length entity header.

Returns:
the header value or null if the Content-Length header is not defined

getContentLocationHeader

String getContentLocationHeader()
Returns the value of the Content-Location entity header.

Returns:
the header value or null if the Content-Location header is not defined

getContentMD5Header

String getContentMD5Header()
Returns the value of the Content-MD5 entity header.

Returns:
the header value or null if the Content-MD5 header is not defined

getContentRangeHeader

String getContentRangeHeader()
Returns the value of the Content-Range entity header.

Returns:
the header value or null if the Content-Range header is not defined

getContentTypeHeader

String getContentTypeHeader()
Returns the value of the Content-Type entity header.

Returns:
the header value or null if the Content-Type header is not defined

getExpiresHeader

String getExpiresHeader()
Returns the value of the Expires entity header.

Returns:
the header value or null if the Expires header is not defined

getLastModifiedHeader

String getLastModifiedHeader()
Returns the value of the Last-Modified entity header.

Returns:
the header value or null if the Last-Modified header is not defined

getAcceptRangesHeader

String getAcceptRangesHeader()
Returns the value of the Accept-Ranges response header.

Returns:
the header value or null if the Accept-Ranges header is not defined

getAgeHeader

String getAgeHeader()
Returns the value of the Age response header.

Returns:
the header value or null if the Age header is not defined

getETagHeader

String getETagHeader()
Returns the value of the ETag response header.

Returns:
the header value or null if the ETag header is not defined

getLocationHeader

String getLocationHeader()
Returns the value of the Location response header.

Returns:
the header value or null if the Location header is not defined

getProxyAuthenticateHeader

String getProxyAuthenticateHeader()
Returns the value of the Proxy-Authenticate response header.

Returns:
the header value or null if the Proxy-Authenticate header is not defined

getRetryAfterHeader

String getRetryAfterHeader()
Returns the value of the Retry-After response header.

Returns:
the header value or null if the Retry-After header is not defined

getServerHeader

String getServerHeader()
Returns the value of the Server response header.

Returns:
the header value or null if the Server header is not defined

getVaryHeader

String getVaryHeader()
Returns the value of the Vary response header.

Returns:
the header value or null if the Vary header is not defined

getWWWAuthenticateHeader

String getWWWAuthenticateHeader()
Returns the value of the WWW-Authenticate response header.

Returns:
the header value or null if the WWW-Authenticate header is not defined

toString

String toString(boolean showDetail)
Returns a string representation of this object.

Parameters:
showDetail - include response body content if set to true
Returns:
a string representation of this object

OpenAPI 1.0


Copyright © 2010 AquaFold, Inc. All Rights Reserved. Use is subject to license terms.