Class DbxRequestConfig


  • public class DbxRequestConfig
    extends java.lang.Object
    A grouping of a few configuration parameters for how we should make requests to the Dropbox servers.
    • Method Detail

      • getClientIdentifier

        public java.lang.String getClientIdentifier()
        Returns the 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.

      • getUserLocale

        public java.lang.String getUserLocale()
        Returns the 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.

      • isAutoRetryEnabled

        public boolean isAutoRetryEnabled()
        Returns whether or not the client should automatically retry RPC and download requests after receiving a 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).

        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 a 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.

        Returns:
        maximum number of times the client will retry a request that throws a RetryException.
      • copy

        public DbxRequestConfig.Builder 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