Class DbxRequestConfig.Builder

    • Method Detail

      • withUserLocale

        public DbxRequestConfig.Builder withUserLocale​(java.lang.String userLocale)
        Set the locale of the app user. User-visible messages returned by the Dropbox servers will be localized to this locale.

        Defaults to null, which means strings will be localized according to the user's Dropbox locale preference.

        Parameters:
        userLocale - locale of app user as an IETF BCP 47 language tag, or null to use the user's Dropbox locale settings.
        Returns:
        this builder
      • withUserLocaleFromPreferences

        public DbxRequestConfig.Builder withUserLocaleFromPreferences()
        Set the locale of user-visible messages returned by the Dropbox servers to the user's Dropbox locale.

        User-visible strings will be localized according to the user's Dropbox locale preference.

        Returns:
        this builder
      • withUserLocaleFrom

        public DbxRequestConfig.Builder withUserLocaleFrom​(java.util.Locale userLocale)
        Set the locale of the app user. User-visible messages returned by the Dropbox servers will be localized to this locale.

        Defaults to null, which means strings will be localized according to the user's Dropbox locale preference.

        Parameters:
        userLocale - Locale of app user, or null to use user's Dropbox locale settings.
        Returns:
        this builder
      • withHttpRequestor

        public DbxRequestConfig.Builder withHttpRequestor​(HttpRequestor httpRequestor)
        Set the HTTP requestor to use for issuing network requests to the Dropbox servers.

        Defaults to StandardHttpRequestor.INSTANCE.

        Parameters:
        httpRequestor - HTTP requestor to use for network requests, never null
        Returns:
        this builder
      • withAutoRetryEnabled

        public DbxRequestConfig.Builder withAutoRetryEnabled()
        Enables automatic retry of RPC and download requests that fail with a 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.

        Returns:
        this builder
      • withAutoRetryEnabled

        public DbxRequestConfig.Builder withAutoRetryEnabled​(int maxRetries)
        Enables automatic retry of RPC and download requests that fail with a 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().

        Parameters:
        maxRetries - maximum number of times to retry a retriable failed request. Must be positive.
        Returns:
        this builder
        Throws:
        java.lang.IllegalArgumentException - if maxRetries is not positive.
      • build

        public DbxRequestConfig build()
        Builds an instance of DbxRequestConfig with this builder's configured parameters or defaults.
        Returns:
        new DbxRequestConfig instance.