public class DbxAppInfo extends Dumpable
Modifier and Type | Field and Description |
---|---|
static JsonReader<java.lang.String> |
KeyReader |
static JsonReader<DbxAppInfo> |
Reader |
static JsonReader<java.lang.String> |
SecretReader |
Constructor and 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) |
Modifier and Type | Method and 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, return
null . |
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, return
null . |
static java.lang.String |
getTokenPartError(java.lang.String s) |
boolean |
hasSecret()
Return if this DbxAppInfo contains app secret.
|
getTypeName, toString, toString, toStringMultiline, toStringMultiline
public static final JsonReader<DbxAppInfo> Reader
public static final JsonReader<java.lang.String> KeyReader
public static final JsonReader<java.lang.String> SecretReader
public DbxAppInfo(java.lang.String key)
key
- Dropbox app key (see getKey()
)DbxPKCEWebAuth
public DbxAppInfo(java.lang.String key, java.lang.String secret)
key
- Dropbox app key (see getKey()
)secret
- Dropbox app secret (see getSecret()
)public DbxAppInfo(java.lang.String key, java.lang.String secret, DbxHost host)
key
- Dropbox app key (see getKey()
)secret
- Dropbox app secret (see getSecret()
)host
- Dropbox host configuration (see getHost()
)public java.lang.String getKey()
public java.lang.String getSecret()
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.
public DbxHost getHost()
This is almost always DbxHost.DEFAULT
. Typically this value will only be
different for testing purposes.
public boolean hasSecret()
DbxPKCEWebAuth
.protected void dumpFields(DumpWriter out)
dumpFields
in class Dumpable
public static java.lang.String getKeyFormatError(java.lang.String key)
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.
public static java.lang.String getSecretFormatError(java.lang.String key)
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.
public static java.lang.String getTokenPartError(java.lang.String s)
public static void checkKeyArg(java.lang.String key)
public static void checkSecretArg(java.lang.String secret)