Package com.dropbox.core.http
Class StandardHttpRequestor.Config
- java.lang.Object
-
- com.dropbox.core.http.StandardHttpRequestor.Config
-
- Enclosing class:
- StandardHttpRequestor
public static final class StandardHttpRequestor.Config extends java.lang.Object
Configuration forStandardHttpRequestor
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 multipleStandardHttpRequestor
objects with different configurations to handle these requests. For example, calls toDbxUserFilesRequests.listFolderLongpoll(String,long)
should use aStandardHttpRequestor
with its read timeout (seeStandardHttpRequestor.Config.Builder.withReadTimeout(long, java.util.concurrent.TimeUnit)
) set longer than the longpoll timeout.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
StandardHttpRequestor.Config.Builder
Builder forStandardHttpRequestor.Config
.
-
Field Summary
Fields Modifier and Type Field Description static StandardHttpRequestor.Config
DEFAULT_INSTANCE
StandardHttpRequestor.Config
with all its attributes set to their default values.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static StandardHttpRequestor.Config.Builder
builder()
Returns a new builder for creating aStandardHttpRequestor.Config
.StandardHttpRequestor.Config.Builder
copy()
Returns a new builder for creating a copy of this config.long
getConnectTimeoutMillis()
Returns the timeout, in milliseconds, for opening a connection to the servers.java.net.Proxy
getProxy()
Returns the proxy configuration for network connections.long
getReadTimeoutMillis()
Returns the timeout, in milliseconds, for receiving a response from the servers.javax.net.ssl.SSLSocketFactory
getSslSocketFactory()
Returns the SSLSocketFactory if provided.
-
-
-
Field Detail
-
DEFAULT_INSTANCE
public static final StandardHttpRequestor.Config DEFAULT_INSTANCE
StandardHttpRequestor.Config
with all its attributes set to their default values.
-
-
Method Detail
-
getProxy
public java.net.Proxy 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
@Nullable public javax.net.ssl.SSLSocketFactory getSslSocketFactory()
Returns the SSLSocketFactory if provided. This is to be used for certificate pinning and other custom SSL configurations.- Returns:
- SSLSocketFactory or null.
-
copy
public StandardHttpRequestor.Config.Builder 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
public static StandardHttpRequestor.Config.Builder builder()
Returns a new builder for creating aStandardHttpRequestor.Config
.- Returns:
- builder for creating an instance of this class
-
-