net.oauth.client
Class OAuthResponseMessage

java.lang.Object
  extended by net.oauth.OAuthMessage
      extended by net.oauth.client.OAuthResponseMessage

public class OAuthResponseMessage
extends OAuthMessage

An HTTP response, encapsulated as an OAuthMessage.

Author:
John Kristian

Field Summary
 
Fields inherited from class net.oauth.OAuthMessage
AUTH_SCHEME, DELETE, GET, method, POST, PUT, URL
 
Method Summary
protected  void completeParameters()
          Finish adding parameters; for example read an HTTP response body and parse parameters from it.
protected  void dump(java.util.Map<java.lang.String,java.lang.Object> into)
           
 java.io.InputStream getBodyAsStream()
          Get a stream from which to read the body of the HTTP request or response.
 java.lang.String getBodyEncoding()
          The character encoding of the body of this message.
 HttpResponseMessage getHttpResponse()
           
 void requireParameters(java.lang.String... names)
          Verify that the required parameter names are contained in the actual collection.
 OAuthProblemException toOAuthProblemException()
          Encapsulate this message as an exception.
 
Methods inherited from class net.oauth.OAuthMessage
addParameter, addParameter, addParameters, addRequiredParameters, decodeAuthorization, getAuthorizationHeader, getBodyType, getConsumerKey, getDump, getHeader, getHeaders, getParameter, getParameterMap, getParameters, getSignature, getSignatureMethod, getToken, readAll, readBodyAsString, sign, toHttpRequest, toString, validateMessage
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Method Detail

getHttpResponse

public HttpResponseMessage getHttpResponse()

getBodyAsStream

public java.io.InputStream getBodyAsStream()
                                    throws java.io.IOException
Description copied from class: OAuthMessage
Get a stream from which to read the body of the HTTP request or response. This is designed to support efficient streaming of a large message. The caller must close the returned stream, to release the underlying resources such as the TCP connection for an HTTP response.

Overrides:
getBodyAsStream in class OAuthMessage
Returns:
a stream from which to read the body, or null to indicate there is no body.
Throws:
java.io.IOException

getBodyEncoding

public java.lang.String getBodyEncoding()
Description copied from class: OAuthMessage
The character encoding of the body of this message.

Overrides:
getBodyEncoding in class OAuthMessage
Returns:
the name of an encoding, or "ISO-8859-1" if no charset has been specified.

requireParameters

public void requireParameters(java.lang.String... names)
                       throws OAuthProblemException,
                              java.io.IOException
Description copied from class: OAuthMessage
Verify that the required parameter names are contained in the actual collection.

Overrides:
requireParameters in class OAuthMessage
Throws:
OAuthProblemException - one or more parameters are absent.
java.io.IOException

toOAuthProblemException

public OAuthProblemException toOAuthProblemException()
                                              throws java.io.IOException
Encapsulate this message as an exception. Read and close the body of this message.

Throws:
java.io.IOException

completeParameters

protected void completeParameters()
                           throws java.io.IOException
Description copied from class: OAuthMessage
Finish adding parameters; for example read an HTTP response body and parse parameters from it.

Overrides:
completeParameters in class OAuthMessage
Throws:
java.io.IOException

dump

protected void dump(java.util.Map<java.lang.String,java.lang.Object> into)
             throws java.io.IOException
Overrides:
dump in class OAuthMessage
Throws:
java.io.IOException


Copyright © 2009. All Rights Reserved.