public static final class DbxRequestConfig.Builder
extends java.lang.Object
DbxRequestConfig.| Modifier and Type | Method and Description |
|---|---|
DbxRequestConfig |
build()
Builds an instance of
DbxRequestConfig with this builder's configured parameters
or defaults. |
DbxRequestConfig.Builder |
withAutoRetryDisabled()
Disables automatic retry of RPC and download requests that fail with a
RetryException. |
DbxRequestConfig.Builder |
withAutoRetryEnabled()
Enables automatic retry of RPC and download requests that fail with a
RetryException. |
DbxRequestConfig.Builder |
withAutoRetryEnabled(int maxRetries)
Enables automatic retry of RPC and download requests that fail with a
RetryException. |
DbxRequestConfig.Builder |
withHttpRequestor(HttpRequestor httpRequestor)
Set the HTTP requestor to use for issuing network requests to the Dropbox servers.
|
DbxRequestConfig.Builder |
withUserLocale(java.lang.String userLocale)
Set the locale of the app user.
|
DbxRequestConfig.Builder |
withUserLocaleFrom(java.util.Locale userLocale)
Set the locale of the app user.
|
DbxRequestConfig.Builder |
withUserLocaleFromPreferences()
Set the locale of user-visible messages returned by the Dropbox servers to the user's
Dropbox locale.
|
public DbxRequestConfig.Builder withUserLocale(java.lang.String userLocale)
Defaults to null, which means strings will be localized according to the
user's Dropbox locale preference.
userLocale - locale of app user as an IETF BCP 47 language tag, or null to
use the user's Dropbox locale settings.public DbxRequestConfig.Builder withUserLocaleFromPreferences()
User-visible strings will be localized according to the user's Dropbox locale preference.
public DbxRequestConfig.Builder withUserLocaleFrom(java.util.Locale userLocale)
Defaults to null, which means strings will be localized according to the
user's Dropbox locale preference.
userLocale - Locale of app user, or null to use user's Dropbox locale settings.public DbxRequestConfig.Builder withHttpRequestor(HttpRequestor httpRequestor)
Defaults to StandardHttpRequestor.INSTANCE.
httpRequestor - HTTP requestor to use for network requests, never nullpublic DbxRequestConfig.Builder withAutoRetryEnabled()
RetryException.
The default number of 3 retries will be used in addition to the initial
request. To specify the maximum number of retries, see withAutoRetryEnabled(int).
By default, the client will not automatically retry any requests.
public DbxRequestConfig.Builder withAutoRetryDisabled()
RetryException.
By default, the client will not automatically retry any requests.
withAutoRetryEnabled()public DbxRequestConfig.Builder withAutoRetryEnabled(int maxRetries)
RetryException.
The client will retry failed requests a maximum of maxRetries times before
propogating the exception. Note that maxRetries does not count the initial
request attempt. For example, if maxRetries is 3, the client may issue a request
a total of 4 times: once for the initial call, then 3 additional times for the 3
retries.
By default, the client will not automatically retry any requests.
To enable automatic retries with the default maximum number of attempts, use withAutoRetryEnabled().
maxRetries - maximum number of times to retry a retriable failed request. Must be
positive.java.lang.IllegalArgumentException - if maxRetries is not positive.public DbxRequestConfig build()
DbxRequestConfig with this builder's configured parameters
or defaults.DbxRequestConfig instance.