com.wizzardo.tools.http
Class Response

java.lang.Object
  extended by com.wizzardo.tools.http.Response

public class Response
extends java.lang.Object


Field Summary
protected  java.net.HttpURLConnection connection
           
protected  java.util.List<Cookie> cookies
           
protected  Request request
           
 
Constructor Summary
protected Response(Request request, java.net.HttpURLConnection connection)
           
 
Method Summary
 byte[] asBytes()
           
 java.io.InputStream asStream()
           
 java.lang.String asString()
           
 java.lang.String asString(java.lang.String charset)
           
 java.util.List<Cookie> cookies()
           
 int getContentLength()
           
 java.util.List<Cookie> getCookies()
           
 java.lang.String getHeader(java.lang.String key)
           
 java.util.Map<java.lang.String,java.util.List<java.lang.String>> getHeaders()
           
 int getResponseCode()
           
 java.lang.String header(java.lang.String key)
           
 int headerInt(java.lang.String key)
           
 int headerInt(java.lang.String key, int def)
           
 java.lang.Long headerLong(java.lang.String key)
           
 long headerLong(java.lang.String key, long def)
           
 java.util.Map<java.lang.String,java.util.List<java.lang.String>> headers()
           
 Request request()
           
 void writeTo(java.io.OutputStream out)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

connection

protected java.net.HttpURLConnection connection

cookies

protected java.util.List<Cookie> cookies

request

protected Request request
Constructor Detail

Response

protected Response(Request request,
                   java.net.HttpURLConnection connection)
Method Detail

asString

public java.lang.String asString()
                          throws java.io.IOException
Throws:
java.io.IOException

asBytes

public byte[] asBytes()
               throws java.io.IOException
Throws:
java.io.IOException

writeTo

public void writeTo(java.io.OutputStream out)
             throws java.io.IOException
Throws:
java.io.IOException

asStream

public java.io.InputStream asStream()
                             throws java.io.IOException
Throws:
java.io.IOException

asString

public java.lang.String asString(java.lang.String charset)
                          throws java.io.IOException
Throws:
java.io.IOException

getCookies

public java.util.List<Cookie> getCookies()

cookies

public java.util.List<Cookie> cookies()

request

public Request request()

getHeader

public java.lang.String getHeader(java.lang.String key)

getHeaders

public java.util.Map<java.lang.String,java.util.List<java.lang.String>> getHeaders()

header

public java.lang.String header(java.lang.String key)

headerInt

public int headerInt(java.lang.String key,
                     int def)

headerLong

public long headerLong(java.lang.String key,
                       long def)

headerInt

public int headerInt(java.lang.String key)

headerLong

public java.lang.Long headerLong(java.lang.String key)

headers

public java.util.Map<java.lang.String,java.util.List<java.lang.String>> headers()

getResponseCode

public int getResponseCode()
                    throws java.io.IOException
Throws:
java.io.IOException

getContentLength

public int getContentLength()
                     throws java.io.IOException
Throws:
java.io.IOException