com.dyuproject.openid
Class SimpleHttpConnector

java.lang.Object
  extended by com.dyuproject.openid.SimpleHttpConnector
All Implemented Interfaces:
HttpConnector

public class SimpleHttpConnector
extends Object
implements HttpConnector

Simple http connector using the built-in HttpURLConnection

Author:
David Yu

Nested Class Summary
 
Nested classes/interfaces inherited from interface com.dyuproject.openid.HttpConnector
HttpConnector.Response
 
Field Summary
 
Fields inherited from interface com.dyuproject.openid.HttpConnector
CONTENT_LENGTH_HEADER, CONTENT_TYPE_HEADER, DELETE, GET, HEAD, POST, PUT, X_WWW_FORM_URLENCODED
 
Constructor Summary
SimpleHttpConnector()
           
 
Method Summary
 HttpConnector.Response doDELETE(String url, Map<?,?> headers)
           
 HttpConnector.Response doDELETE(String url, Map<?,?> headers, Map<?,?> parameters)
           
 HttpConnector.Response doGET(String url, Map<?,?> headers)
           
 HttpConnector.Response doGET(String url, Map<?,?> headers, Map<?,?> parameters)
           
 HttpConnector.Response doHEAD(String url, Map<?,?> headers)
           
 HttpConnector.Response doPOST(String url, Map<?,?> headers, Map<?,?> parameters, String charset)
           
 HttpConnector.Response doPOST(String url, Map<?,?> headers, String contentType, byte[] data)
           
 HttpConnector.Response doPOST(String url, Map<?,?> headers, String contentType, InputStreamReader reader)
           
 HttpConnector.Response doPUT(String url, Map<?,?> headers, Map<?,?> parameters, String charset)
           
 HttpConnector.Response doPUT(String url, Map<?,?> headers, String contentType, byte[] data)
           
 HttpConnector.Response doPUT(String url, Map<?,?> headers, String contentType, InputStreamReader reader)
           
static int getBufferSize()
           
static void setBufferSize(int bufferSize)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SimpleHttpConnector

public SimpleHttpConnector()
Method Detail

setBufferSize

public static void setBufferSize(int bufferSize)

getBufferSize

public static int getBufferSize()

doHEAD

public HttpConnector.Response doHEAD(String url,
                                     Map<?,?> headers)
                              throws IOException
Specified by:
doHEAD in interface HttpConnector
Throws:
IOException

doGET

public HttpConnector.Response doGET(String url,
                                    Map<?,?> headers)
                             throws IOException
Specified by:
doGET in interface HttpConnector
Throws:
IOException

doGET

public HttpConnector.Response doGET(String url,
                                    Map<?,?> headers,
                                    Map<?,?> parameters)
                             throws IOException
Specified by:
doGET in interface HttpConnector
Throws:
IOException

doDELETE

public HttpConnector.Response doDELETE(String url,
                                       Map<?,?> headers)
                                throws IOException
Specified by:
doDELETE in interface HttpConnector
Throws:
IOException

doDELETE

public HttpConnector.Response doDELETE(String url,
                                       Map<?,?> headers,
                                       Map<?,?> parameters)
                                throws IOException
Specified by:
doDELETE in interface HttpConnector
Throws:
IOException

doPOST

public HttpConnector.Response doPOST(String url,
                                     Map<?,?> headers,
                                     Map<?,?> parameters,
                                     String charset)
                              throws IOException
Specified by:
doPOST in interface HttpConnector
Throws:
IOException

doPOST

public HttpConnector.Response doPOST(String url,
                                     Map<?,?> headers,
                                     String contentType,
                                     byte[] data)
                              throws IOException
Specified by:
doPOST in interface HttpConnector
Throws:
IOException

doPOST

public HttpConnector.Response doPOST(String url,
                                     Map<?,?> headers,
                                     String contentType,
                                     InputStreamReader reader)
                              throws IOException
Specified by:
doPOST in interface HttpConnector
Throws:
IOException

doPUT

public HttpConnector.Response doPUT(String url,
                                    Map<?,?> headers,
                                    Map<?,?> parameters,
                                    String charset)
                             throws IOException
Specified by:
doPUT in interface HttpConnector
Throws:
IOException

doPUT

public HttpConnector.Response doPUT(String url,
                                    Map<?,?> headers,
                                    String contentType,
                                    byte[] data)
                             throws IOException
Specified by:
doPUT in interface HttpConnector
Throws:
IOException

doPUT

public HttpConnector.Response doPUT(String url,
                                    Map<?,?> headers,
                                    String contentType,
                                    InputStreamReader reader)
                             throws IOException
Specified by:
doPUT in interface HttpConnector
Throws:
IOException


Copyright © 2013. All Rights Reserved.