Package com.dropbox.core.http
Class StandardHttpRequestor.Config
java.lang.Object
com.dropbox.core.http.StandardHttpRequestor.Config
- Enclosing class:
StandardHttpRequestor
Configuration for
StandardHttpRequestor that determines
how network connections to the server are established.
Use this class to configure timeouts and proxy settings.
Some requests may require different connection settings than
others. Create multiple StandardHttpRequestor objects
with different configurations to handle these requests. For
example, calls to DbxUserFilesRequests.listFolderLongpoll(String,long) should
use a StandardHttpRequestor with its read timeout (see
StandardHttpRequestor.Config.Builder.withReadTimeout(long, java.util.concurrent.TimeUnit)) set longer than the longpoll
timeout.-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StandardHttpRequestor.ConfigStandardHttpRequestor.Configwith all its attributes set to their default values. -
Method Summary
Modifier and TypeMethodDescriptionbuilder()Returns a new builder for creating aStandardHttpRequestor.Config.copy()Returns a new builder for creating a copy of this config.longReturns the timeout, in milliseconds, for opening a connection to the servers.getProxy()Returns the proxy configuration for network connections.longReturns the timeout, in milliseconds, for receiving a response from the servers.Returns the SSLSocketFactory if provided.
-
Field Details
-
DEFAULT_INSTANCE
StandardHttpRequestor.Configwith all its attributes set to their default values.
-
-
Method Details
-
getProxy
Returns the proxy configuration for network connections.- Returns:
- proxy configuration to use for network connections.
-
getConnectTimeoutMillis
public long getConnectTimeoutMillis()Returns the timeout, in milliseconds, for opening a connection to the servers. If the timeout is 0, then connect timeouts are disabled.- Returns:
- timeout, in milliseconds, for opening connections to the servers.
-
getReadTimeoutMillis
public long getReadTimeoutMillis()Returns the timeout, in milliseconds, for receiving a response from the servers. If the timeout is 0, then read timeouts are disabled.- Returns:
- timeout, in milliseconds, for receiving a response from the server.
-
getSslSocketFactory
Returns the SSLSocketFactory if provided. This is to be used for certificate pinning and other custom SSL configurations.- Returns:
- SSLSocketFactory or null.
-
copy
Returns a new builder for creating a copy of this config. The builder is configured to use this config's values as its default.- Returns:
- builder for creating a copy of this config.
-
builder
Returns a new builder for creating aStandardHttpRequestor.Config.- Returns:
- builder for creating an instance of this class
-