Class DbxAppInfo


  • public class DbxAppInfo
    extends Dumpable
    Identifying information about your application.
    • Constructor Detail

      • DbxAppInfo

        public DbxAppInfo​(java.lang.String key)
        DbxAppInfo without secret. Should only be used in PKCE flow.
        Parameters:
        key - Dropbox app key (see getKey())
        See Also:
        DbxPKCEWebAuth
      • DbxAppInfo

        public DbxAppInfo​(java.lang.String key,
                          java.lang.String secret)
        Parameters:
        key - Dropbox app key (see getKey())
        secret - Dropbox app secret (see getSecret())
      • DbxAppInfo

        public DbxAppInfo​(java.lang.String key,
                          java.lang.String secret,
                          DbxHost host)
        Parameters:
        key - Dropbox app key (see getKey())
        secret - Dropbox app secret (see getSecret())
        host - Dropbox host configuration (see getHost())
    • Method Detail

      • getKey

        public java.lang.String getKey()
        Returns the Dropbox app key (OAuth calls this the consumer key). You can create an app key and secret on the Dropbox developer website.
        Returns:
        Dropbox app key
      • getSecret

        public java.lang.String getSecret()
        Returns the Dropbox app secret (OAuth calls this the consumer secret). You can create an app key and secret on the Dropbox developer website.

        Make sure that this is kept a secret. Someone with your app secret can impesonate your application. People sometimes ask for help on the Dropbox API forums and copy/paste their code, which sometimes includes their app secret. Do not do that.

        Returns:
        Dropbox app secret
      • getHost

        public DbxHost getHost()
        Returns the Dropbox host configuration.

        This is almost always DbxHost.DEFAULT. Typically this value will only be different for testing purposes.

        Returns:
        Dropbox host configuration
      • hasSecret

        public boolean hasSecret()
        Return if this DbxAppInfo contains app secret. DbxAppInfo without secret should only be used in DbxPKCEWebAuth.
        Returns:
        If this DbxAppInfo contains app secret.
      • getKeyFormatError

        public static java.lang.String getKeyFormatError​(java.lang.String key)
        If they key's format looks correct, return null. Otherwise return a string that describes what the problem is.

        NOTE: This function only performs some cursory checks on the format of the key. Even if it returns null (which means "no problem"), it doesn't mean that what you passed in is an actual valid Dropbox API app key.

      • getSecretFormatError

        public static java.lang.String getSecretFormatError​(java.lang.String key)
        If they secret's format looks correct, return null. Otherwise return a string that describes what the problem is.

        NOTE: This function only performs some cursory checks on the format. Even if it returns null (which means "no problem"), it doesn't mean that what you passed in is an actual valid Dropbox API app key.

      • getTokenPartError

        public static java.lang.String getTokenPartError​(java.lang.String s)
      • checkKeyArg

        public static void checkKeyArg​(java.lang.String key)
      • checkSecretArg

        public static void checkSecretArg​(java.lang.String secret)