public class DbxRequestConfig
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
static class |
DbxRequestConfig.Builder
Builder for
DbxRequestConfig . |
Constructor and Description |
---|
DbxRequestConfig(java.lang.String clientIdentifier)
Creates a new configuration.
|
DbxRequestConfig(java.lang.String clientIdentifier,
java.lang.String userLocale)
Deprecated.
Use
newBuilder(java.lang.String) to customize configuration |
DbxRequestConfig(java.lang.String clientIdentifier,
java.lang.String userLocale,
HttpRequestor httpRequestor)
Deprecated.
Use
newBuilder(java.lang.String) to customize configuration |
Modifier and Type | Method and Description |
---|---|
DbxRequestConfig.Builder |
copy()
Returns a builder for building a copy of this configuration.
|
java.lang.String |
getClientIdentifier()
Returns the
clientIdentifier you passed in when constructing this object. |
HttpRequestor |
getHttpRequestor()
Returns the
HttpRequestor you passed in when constructing this object, which
defaults to StandardHttpRequestor.INSTANCE . |
int |
getMaxRetries()
Returns the maximum number of times the client should automatically retry RPC and download
requests that fail with a
RetryException . |
java.lang.String |
getUserLocale()
Returns the
userLocale you passed in when constructing this object, which
defaults to null . |
boolean |
isAutoRetryEnabled()
Returns whether or not the client should automatically retry RPC and download requests after
receiving a
RetryException . |
static DbxRequestConfig.Builder |
newBuilder(java.lang.String clientIdentifier)
Returns a new builder for creating a
DbxRequestConfig instance. |
public DbxRequestConfig(java.lang.String clientIdentifier)
clientIdentifier
- see getClientIdentifier()
@Deprecated public DbxRequestConfig(java.lang.String clientIdentifier, java.lang.String userLocale)
newBuilder(java.lang.String)
to customize configurationclientIdentifier
- see getClientIdentifier()
userLocale
- see getUserLocale()
@Deprecated public DbxRequestConfig(java.lang.String clientIdentifier, java.lang.String userLocale, HttpRequestor httpRequestor)
newBuilder(java.lang.String)
to customize configurationclientIdentifier
- see getClientIdentifier()
userLocale
- see getUserLocale()
httpRequestor
- see getHttpRequestor()
public java.lang.String getClientIdentifier()
clientIdentifier
you passed in when constructing this object.
The client identifier is usually of the form "SoftwareName/SoftwareVersion".
For example, if you have a project named "PhotoEdit", your might set the client
identifier to "PhotoEditServer/1.3"
in your server software and to
"PhotoEditAndroid/1.8"
in your Android app.
This value is prepended to the "User-Agent" HTTP header on all requests made to the Dropbox API. This has no effect on the behavior of the Dropbox API, but it may help identify your application when debugging things later.
public java.lang.String getUserLocale()
userLocale
you passed in when constructing this object, which
defaults to null
.
This should be set to the IETF BCP 47 language tag of the end user currently using your software. Example: "en-US".
This value is passed in as the "Dropbox-API-User-Locale" HTTP header on all requests made to the Dropbox API. It controls the language used by the Dropbox API for certain return values, e.g. like error messages intended for the user.
If null
, or if set to a value Dropbox doesn't support, the server will default
to the user's configured locale setting.
public HttpRequestor getHttpRequestor()
HttpRequestor
you passed in when constructing this object, which
defaults to StandardHttpRequestor.INSTANCE
.public boolean isAutoRetryEnabled()
RetryException
.
If enabled, the client will retry the request a max number of times (specified by getMaxRetries()
) before propagating the RetryException
.
Defaults to false
(the client will not automatically retry any requests).
RetryException
public int getMaxRetries()
RetryException
.
This value does not count the initial request attempt. For example, if maximum retries 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.
This value is ignored unless isAutoRetryEnabled()
is true
.
The value returned by this method is always positive if retries are enabled, otherwise it
is 0
.
Defaults to 3
when retries are enabled.
RetryException
.public DbxRequestConfig.Builder copy()
public static DbxRequestConfig.Builder newBuilder(java.lang.String clientIdentifier)
DbxRequestConfig
instance.clientIdentifier
- see getClientIdentifier()