Class DbxAppInfo
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final JsonReader<String> static final JsonReader<DbxAppInfo> static final JsonReader<String> -
Constructor Summary
ConstructorsConstructorDescriptionDbxAppInfo(String key) DbxAppInfo without secret.DbxAppInfo(String key, String secret) DbxAppInfo(String key, String secret, DbxHost host) -
Method Summary
Modifier and TypeMethodDescriptionstatic voidcheckKeyArg(String key) static voidcheckSecretArg(String secret) protected voiddumpFields(DumpWriter out) getHost()Returns the Dropbox host configuration.getKey()Returns the Dropbox app key (OAuth calls this the consumer key).static StringgetKeyFormatError(String key) If they key's format looks correct, returnnull.Returns the Dropbox app secret (OAuth calls this the consumer secret).static StringIf they secret's format looks correct, returnnull.static StringbooleanReturn if this DbxAppInfo contains app secret.Methods inherited from class com.dropbox.core.util.Dumpable
getTypeName, toString, toString, toStringMultiline, toStringMultiline
-
Field Details
-
Reader
-
KeyReader
-
SecretReader
-
-
Constructor Details
-
DbxAppInfo
DbxAppInfo without secret. Should only be used in PKCE flow.- Parameters:
key- Dropbox app key (seegetKey())- See Also:
-
DbxAppInfo
- Parameters:
key- Dropbox app key (seegetKey())secret- Dropbox app secret (seegetSecret())
-
DbxAppInfo
- Parameters:
key- Dropbox app key (seegetKey())secret- Dropbox app secret (seegetSecret())host- Dropbox host configuration (seegetHost())
-
-
Method Details
-
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
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
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
- Specified by:
dumpFieldsin classDumpable
-
getKeyFormatError
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
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
-
checkKeyArg
-
checkSecretArg
-