Class DbxRawClientV2


  • public abstract class DbxRawClientV2
    extends java.lang.Object
    Use this class to make remote calls to the Dropbox API. You'll need an access token first, normally acquired via DbxWebAuth.

    This class has no mutable state, so it's thread safe as long as you pass in a thread safe HttpRequestor implementation.

    • Constructor Detail

      • DbxRawClientV2

        protected DbxRawClientV2​(DbxRequestConfig requestConfig,
                                 DbxHost host,
                                 java.lang.String userId,
                                 PathRoot pathRoot)
        Parameters:
        requestConfig - Configuration controlling How requests should be issued to Dropbox servers.
        host - Dropbox server hostnames (primarily for internal use)
        userId - The user ID of the current Dropbox account. Used for multi-Dropbox account use-case.
        pathRoot - We will send this value in Dropbox-API-Path-Root header if it presents.
    • Method Detail

      • addAuthHeaders

        protected abstract void addAuthHeaders​(java.util.List<HttpRequestor.Header> headers)
        Add the appropriate authentication headers to the request, if any.
        Parameters:
        headers - List of request headers. Add authentication headers to this list.
      • canRefreshAccessToken

        protected abstract boolean canRefreshAccessToken()
      • needsRefreshAccessToken

        protected abstract boolean needsRefreshAccessToken()
      • withPathRoot

        protected abstract DbxRawClientV2 withPathRoot​(PathRoot pathRoot)
        Clone a new DbxRawClientV2 with Dropbox-API-Path-Root header.
        Parameters:
        pathRoot - pathRoot object containing the content for Dropbox-API-Path-Root header.
      • getRequestConfig

        public DbxRequestConfig getRequestConfig()
        Returns the DbxRequestConfig that was passed in to the constructor.
        Returns:
        configuration to use for issuing requests.
      • getHost

        public DbxHost getHost()
        Returns the DbxHost that was passed in to the constructor.
        Returns:
        Dropbox hosts to use for requests.
      • getUserId

        public java.lang.String getUserId()
        Returns the userId that was passed in to the constructor.
        Returns:
        The user ID of the current Dropbox account.