Package net.oauth.client
Class OAuthResponseMessage
- java.lang.Object
-
- net.oauth.OAuthMessage
-
- 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
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidcompleteParameters()Finish adding parameters; for example read an HTTP response body and parse parameters from it.protected voiddump(Map<String,Object> into)InputStreamgetBodyAsStream()Get a stream from which to read the body of the HTTP request or response.StringgetBodyEncoding()The character encoding of the body of this message.HttpResponseMessagegetHttpResponse()voidrequireParameters(String... names)Verify that the required parameter names are contained in the actual collection.OAuthProblemExceptiontoOAuthProblemException()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
-
-
-
-
Method Detail
-
getHttpResponse
public HttpResponseMessage getHttpResponse()
-
getBodyAsStream
public InputStream getBodyAsStream() throws IOException
Description copied from class:OAuthMessageGet 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:
getBodyAsStreamin classOAuthMessage- Returns:
- a stream from which to read the body, or null to indicate there is no body.
- Throws:
IOException
-
getBodyEncoding
public String getBodyEncoding()
Description copied from class:OAuthMessageThe character encoding of the body of this message.- Overrides:
getBodyEncodingin classOAuthMessage- Returns:
- the name of an encoding, or "ISO-8859-1" if no charset has been specified.
-
requireParameters
public void requireParameters(String... names) throws OAuthProblemException, IOException
Description copied from class:OAuthMessageVerify that the required parameter names are contained in the actual collection.- Overrides:
requireParametersin classOAuthMessage- Throws:
OAuthProblemException- one or more parameters are absent.IOException
-
toOAuthProblemException
public OAuthProblemException toOAuthProblemException() throws IOException
Encapsulate this message as an exception. Read and close the body of this message.- Throws:
IOException
-
completeParameters
protected void completeParameters() throws IOExceptionDescription copied from class:OAuthMessageFinish adding parameters; for example read an HTTP response body and parse parameters from it.- Overrides:
completeParametersin classOAuthMessage- Throws:
IOException
-
dump
protected void dump(Map<String,Object> into) throws IOException
- Overrides:
dumpin classOAuthMessage- Throws:
IOException
-
-