Class StandardHttpRequestor
- java.lang.Object
- 
- com.dropbox.core.http.HttpRequestor
- 
- com.dropbox.core.http.StandardHttpRequestor
 
 
- 
 public class StandardHttpRequestor extends HttpRequestor HttpRequestorimplementation that uses Java's standard libraryHttpsURLConnection. If you just want a connection with the default settings, use the predefinedINSTANCE.If you want to customize the way the connection is configured, create a subclass that overrides configureConnection(javax.net.ssl.HttpsURLConnection).
- 
- 
Nested Class SummaryNested Classes Modifier and Type Class Description static classStandardHttpRequestor.ConfigConfiguration forStandardHttpRequestorthat determines how network connections to the server are established.- 
Nested classes/interfaces inherited from class com.dropbox.core.http.HttpRequestorHttpRequestor.Header, HttpRequestor.Response
 
- 
 - 
Field SummaryFields Modifier and Type Field Description static StandardHttpRequestorINSTANCEA thread-safe instance ofStandardHttpRequestorthat connects directly (as opposed to using a proxy).- 
Fields inherited from class com.dropbox.core.http.HttpRequestorDEFAULT_CONNECT_TIMEOUT_MILLIS, DEFAULT_READ_TIMEOUT_MILLIS
 
- 
 - 
Constructor SummaryConstructors Constructor Description StandardHttpRequestor(StandardHttpRequestor.Config config)Creates an instance that connects through the given proxy.
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description protected voidconfigure(java.net.HttpURLConnection conn)Can be overriden to configure the underlyingHttpURLConnectionused to make network requests using https.protected voidconfigureConnection(javax.net.ssl.HttpsURLConnection conn)Deprecated.useconfigure(java.net.HttpURLConnection)instead.HttpRequestor.ResponsedoGet(java.lang.String url, java.lang.Iterable<HttpRequestor.Header> headers)protected voidinterceptResponse(java.net.HttpURLConnection conn)Called before returningHttpRequestor.Responsefrom a request.protected java.net.HttpURLConnectionprepRequest(java.lang.String url, java.lang.Iterable<HttpRequestor.Header> headers, boolean streaming)com.dropbox.core.http.StandardHttpRequestor.UploaderstartPost(java.lang.String url, java.lang.Iterable<HttpRequestor.Header> headers)com.dropbox.core.http.StandardHttpRequestor.UploaderstartPostInStreamingMode(java.lang.String url, java.lang.Iterable<HttpRequestor.Header> headers)com.dropbox.core.http.StandardHttpRequestor.UploaderstartPut(java.lang.String url, java.lang.Iterable<HttpRequestor.Header> headers)
 
- 
- 
- 
Field Detail- 
INSTANCEpublic static final StandardHttpRequestor INSTANCE A thread-safe instance ofStandardHttpRequestorthat connects directly (as opposed to using a proxy).
 
- 
 - 
Constructor Detail- 
StandardHttpRequestorpublic StandardHttpRequestor(StandardHttpRequestor.Config config) Creates an instance that connects through the given proxy.
 
- 
 - 
Method Detail- 
doGetpublic HttpRequestor.Response doGet(java.lang.String url, java.lang.Iterable<HttpRequestor.Header> headers) throws java.io.IOException - Specified by:
- doGetin class- HttpRequestor
- Throws:
- java.io.IOException
 
 - 
startPostpublic com.dropbox.core.http.StandardHttpRequestor.Uploader startPost(java.lang.String url, java.lang.Iterable<HttpRequestor.Header> headers) throws java.io.IOException- Specified by:
- startPostin class- HttpRequestor
- Throws:
- java.io.IOException
 
 - 
startPostInStreamingModepublic com.dropbox.core.http.StandardHttpRequestor.Uploader startPostInStreamingMode(java.lang.String url, java.lang.Iterable<HttpRequestor.Header> headers) throws java.io.IOException- Overrides:
- startPostInStreamingModein class- HttpRequestor
- Throws:
- java.io.IOException
 
 - 
startPutpublic com.dropbox.core.http.StandardHttpRequestor.Uploader startPut(java.lang.String url, java.lang.Iterable<HttpRequestor.Header> headers) throws java.io.IOException- Specified by:
- startPutin class- HttpRequestor
- Throws:
- java.io.IOException
 
 - 
configureConnection@Deprecated protected void configureConnection(javax.net.ssl.HttpsURLConnection conn) throws java.io.IOExceptionDeprecated.useconfigure(java.net.HttpURLConnection)instead.Can be overridden to configure the underlyingHttpsURLConnectionused to make network requests. If you override this method, you should probably callsuper.configureConnection(conn)in your overridden method.- Throws:
- java.io.IOException
 
 - 
configureprotected void configure(java.net.HttpURLConnection conn) throws java.io.IOExceptionCan be overriden to configure the underlyingHttpURLConnectionused to make network requests using https. Typically the connection will be aHttpsURLConnection, but that is dependent on the Java runtime. Care should be taken when casting the connection (check your JRE).If you are using Google App Engine, configure your DbxRequestConfigto useGoogleAppEngineRequestoras its defaultHttpRequestor. If you useStandardHttpRequestorin Google App Engine, SSL certificates may not be validated and your app will susceptible to Man-in-the-Middle attacks.- Parameters:
- conn- URL connection object returned after creating an https network request.
- Throws:
- java.io.IOException
 
 - 
interceptResponseprotected void interceptResponse(java.net.HttpURLConnection conn) throws java.io.IOExceptionCalled before returningHttpRequestor.Responsefrom a request.This method should be used by subclasses to add any logging, analytics, or cleanup necessary. Note that the connection response code and response streams will already be fetched before calling this method. This means any IOExceptionfrom reading the response should already have occurred before this method is called.Do not consume the response or error streams in this method. - Parameters:
- conn- HTTP URL connection
- Throws:
- java.io.IOException
 
 - 
prepRequestprotected java.net.HttpURLConnection prepRequest(java.lang.String url, java.lang.Iterable<HttpRequestor.Header> headers, boolean streaming) throws java.io.IOException- Throws:
- java.io.IOException
 
 
- 
 
-