org.brickred.socialauth.util
Class Response

java.lang.Object
  extended by org.brickred.socialauth.util.Response

public class Response
extends Object

Encapsulates the HTTP status, headers and the content.

Author:
tarunn@brickred.com

Method Summary
 void close()
          Closes the connection
 String getHeader(String name)
           
 InputStream getInputStream()
          Gets the response content via InputStream.
 String getResponseBodyAsString(String encoding)
          Gets the response content as String using given encoding
 int getStatus()
          Gets the response HTTP status.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

close

public void close()
           throws IOException
Closes the connection

Throws:
IOException

getHeader

public String getHeader(String name)

getInputStream

public InputStream getInputStream()
                           throws IOException
Gets the response content via InputStream.

Returns:
response input stream
Throws:
IOException

getStatus

public int getStatus()
Gets the response HTTP status.

Returns:
the HTTP status

getResponseBodyAsString

public String getResponseBodyAsString(String encoding)
                               throws Exception
Gets the response content as String using given encoding

Parameters:
encoding - the encoding type
Returns:
Response body
Throws:
Exception


Copyright © 2013. All Rights Reserved.