net.oauth.client
Class URLConnectionResponse

java.lang.Object
  extended by net.oauth.http.HttpMessage
      extended by net.oauth.http.HttpResponseMessage
          extended by net.oauth.client.URLConnectionResponse

public class URLConnectionResponse
extends net.oauth.http.HttpResponseMessage

The response part of a URLConnection, encapsulated as an HttpMessage.

Author:
John Kristian

Field Summary
private  URLConnection connection
           
private  String requestEncoding
           
private  byte[] requestExcerpt
           
private  String requestHeaders
           
 
Fields inherited from class net.oauth.http.HttpResponseMessage
EOL, LOCATION, STATUS_CODE, STATUS_OK
 
Fields inherited from class net.oauth.http.HttpMessage
ACCEPT_ENCODING, body, CONTENT_ENCODING, CONTENT_LENGTH, CONTENT_TYPE, DEFAULT_CHARSET, headers, method, REQUEST, RESPONSE, url
 
Constructor Summary
URLConnectionResponse(net.oauth.http.HttpMessage request, String requestHeaders, byte[] requestExcerpt, URLConnection connection)
          Construct an OAuthMessage from the HTTP response, including parameters from OAuth WWW-Authenticate headers and the body.
 
Method Summary
 void dump(Map<String,Object> into)
          Return a complete description of the HTTP exchange.
private  List<Map.Entry<String,String>> getHeaders()
           
 int getStatusCode()
           
 InputStream openBody()
           
 
Methods inherited from class net.oauth.http.HttpMessage
getBody, getContentCharset, getHeader, newRequest, removeHeaders
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

requestHeaders

private final String requestHeaders

requestExcerpt

private final byte[] requestExcerpt

requestEncoding

private final String requestEncoding

connection

private final URLConnection connection
Constructor Detail

URLConnectionResponse

public URLConnectionResponse(net.oauth.http.HttpMessage request,
                             String requestHeaders,
                             byte[] requestExcerpt,
                             URLConnection connection)
                      throws IOException
Construct an OAuthMessage from the HTTP response, including parameters from OAuth WWW-Authenticate headers and the body. The header parameters come first, followed by the ones from the response body.

Throws:
IOException
Method Detail

getStatusCode

public int getStatusCode()
                  throws IOException
Specified by:
getStatusCode in class net.oauth.http.HttpResponseMessage
Throws:
IOException

openBody

public InputStream openBody()
Overrides:
openBody in class net.oauth.http.HttpMessage

getHeaders

private List<Map.Entry<String,String>> getHeaders()

dump

public void dump(Map<String,Object> into)
          throws IOException
Return a complete description of the HTTP exchange.

Overrides:
dump in class net.oauth.http.HttpResponseMessage
Throws:
IOException


Copyright © 2016. All rights reserved.