Class DbxRequestConfig
-
Nested Class Summary
Nested Classes -
Constructor Summary
ConstructorsConstructorDescriptionDbxRequestConfig(String clientIdentifier) Creates a new configuration.DbxRequestConfig(String clientIdentifier, String userLocale) Deprecated.DbxRequestConfig(String clientIdentifier, String userLocale, HttpRequestor httpRequestor) Deprecated.UsenewBuilder(java.lang.String)to customize configuration -
Method Summary
Modifier and TypeMethodDescriptioncopy()Returns a builder for building a copy of this configuration.Returns theclientIdentifieryou passed in when constructing this object.Returns theHttpRequestoryou passed in when constructing this object, which defaults toStandardHttpRequestor.INSTANCE.intReturns the maximum number of times the client should automatically retry RPC and download requests that fail with aRetryException.Returns theuserLocaleyou passed in when constructing this object, which defaults tonull.booleanReturns whether or not the client should automatically retry RPC and download requests after receiving aRetryException.static DbxRequestConfig.BuildernewBuilder(String clientIdentifier) Returns a new builder for creating aDbxRequestConfiginstance.
-
Constructor Details
-
DbxRequestConfig
Creates a new configuration.- Parameters:
clientIdentifier- seegetClientIdentifier()
-
DbxRequestConfig
Deprecated.UsenewBuilder(java.lang.String)to customize configurationCreates a new configuration.- Parameters:
clientIdentifier- seegetClientIdentifier()userLocale- seegetUserLocale()
-
DbxRequestConfig
@Deprecated public DbxRequestConfig(String clientIdentifier, String userLocale, HttpRequestor httpRequestor) Deprecated.UsenewBuilder(java.lang.String)to customize configurationCreates a new configuration.- Parameters:
clientIdentifier- seegetClientIdentifier()userLocale- seegetUserLocale()httpRequestor- seegetHttpRequestor()
-
-
Method Details
-
getClientIdentifier
Returns theclientIdentifieryou 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.
-
getUserLocale
Returns theuserLocaleyou passed in when constructing this object, which defaults tonull.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. -
getHttpRequestor
Returns theHttpRequestoryou passed in when constructing this object, which defaults toStandardHttpRequestor.INSTANCE. -
isAutoRetryEnabled
public boolean isAutoRetryEnabled()Returns whether or not the client should automatically retry RPC and download requests after receiving aRetryException.If enabled, the client will retry the request a max number of times (specified by
getMaxRetries()) before propagating theRetryException.Defaults to
false(the client will not automatically retry any requests).- Returns:
- whether this client will automatically retry requests that fail with a
RetryException
-
getMaxRetries
public int getMaxRetries()Returns the maximum number of times the client should automatically retry RPC and download requests that fail with aRetryException.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()istrue.The value returned by this method is always positive if retries are enabled, otherwise it is
0.Defaults to
3when retries are enabled.- Returns:
- maximum number of times the client will retry a request that throws a
RetryException.
-
copy
Returns a builder for building a copy of this configuration. Useful for modifying an existing configuration.- Returns:
- builder configured to build a copy of this instance
-
newBuilder
Returns a new builder for creating aDbxRequestConfiginstance.- Parameters:
clientIdentifier- seegetClientIdentifier()
-
newBuilder(java.lang.String)to customize configuration