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 HttpResponseMessage

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

Author:
John Kristian

Field Summary
 
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(HttpMessage request, java.lang.String requestHeaders, byte[] requestExcerpt, java.net.URLConnection connection)
          Construct an OAuthMessage from the HTTP response, including parameters from OAuth WWW-Authenticate headers and the body.
 
Method Summary
 void dump(java.util.Map<java.lang.String,java.lang.Object> into)
          Return a complete description of the HTTP exchange.
protected  java.lang.String getHeaderField(java.net.URLConnection connection, int index)
           
protected  java.lang.String getHeaderFieldKey(java.net.URLConnection connection, int index)
           
 int getStatusCode()
           
 java.io.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
 

Constructor Detail

URLConnectionResponse

public URLConnectionResponse(HttpMessage request,
                             java.lang.String requestHeaders,
                             byte[] requestExcerpt,
                             java.net.URLConnection connection)
                      throws java.io.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:
java.io.IOException
Method Detail

getStatusCode

public int getStatusCode()
                  throws java.io.IOException
Specified by:
getStatusCode in class HttpResponseMessage
Throws:
java.io.IOException

openBody

public java.io.InputStream openBody()
Overrides:
openBody in class HttpMessage

getHeaderField

protected java.lang.String getHeaderField(java.net.URLConnection connection,
                                          int index)

getHeaderFieldKey

protected java.lang.String getHeaderFieldKey(java.net.URLConnection connection,
                                             int index)

dump

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

Overrides:
dump in class HttpResponseMessage
Throws:
java.io.IOException


Copyright © 2009. All Rights Reserved.