Class DbxAppInfo
- java.lang.Object
-
- com.dropbox.core.util.Dumpable
-
- com.dropbox.core.DbxAppInfo
-
public class DbxAppInfo extends Dumpable
Identifying information about your application.
-
-
Field Summary
Fields Modifier and Type Field Description static JsonReader<java.lang.String>
KeyReader
static JsonReader<DbxAppInfo>
Reader
static JsonReader<java.lang.String>
SecretReader
-
Constructor Summary
Constructors Constructor Description DbxAppInfo(java.lang.String key)
DbxAppInfo without secret.DbxAppInfo(java.lang.String key, java.lang.String secret)
DbxAppInfo(java.lang.String key, java.lang.String secret, DbxHost host)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static void
checkKeyArg(java.lang.String key)
static void
checkSecretArg(java.lang.String secret)
protected void
dumpFields(DumpWriter out)
DbxHost
getHost()
Returns the Dropbox host configuration.java.lang.String
getKey()
Returns the Dropbox app key (OAuth calls this the consumer key).static java.lang.String
getKeyFormatError(java.lang.String key)
If they key's format looks correct, returnnull
.java.lang.String
getSecret()
Returns the Dropbox app secret (OAuth calls this the consumer secret).static java.lang.String
getSecretFormatError(java.lang.String key)
If they secret's format looks correct, returnnull
.static java.lang.String
getTokenPartError(java.lang.String s)
boolean
hasSecret()
Return if this DbxAppInfo contains app secret.-
Methods inherited from class com.dropbox.core.util.Dumpable
getTypeName, toString, toString, toStringMultiline, toStringMultiline
-
-
-
-
Field Detail
-
Reader
public static final JsonReader<DbxAppInfo> Reader
-
KeyReader
public static final JsonReader<java.lang.String> KeyReader
-
SecretReader
public static final JsonReader<java.lang.String> SecretReader
-
-
Constructor Detail
-
DbxAppInfo
public DbxAppInfo(java.lang.String key)
DbxAppInfo without secret. Should only be used in PKCE flow.- Parameters:
key
- Dropbox app key (seegetKey()
)- See Also:
DbxPKCEWebAuth
-
DbxAppInfo
public DbxAppInfo(java.lang.String key, java.lang.String secret)
- Parameters:
key
- Dropbox app key (seegetKey()
)secret
- Dropbox app secret (seegetSecret()
)
-
DbxAppInfo
public DbxAppInfo(java.lang.String key, java.lang.String secret, DbxHost host)
- Parameters:
key
- Dropbox app key (seegetKey()
)secret
- Dropbox app secret (seegetSecret()
)host
- Dropbox host configuration (seegetHost()
)
-
-
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 inDbxPKCEWebAuth
.- Returns:
- If this DbxAppInfo contains app secret.
-
dumpFields
protected void dumpFields(DumpWriter out)
- Specified by:
dumpFields
in classDumpable
-
getKeyFormatError
public static java.lang.String getKeyFormatError(java.lang.String key)
If they key's format looks correct, returnnull
. 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, returnnull
. 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)
-
-