Class FileCredentialStore
java.lang.Object
com.google.api.client.extensions.java6.auth.oauth2.FileCredentialStore
- All Implemented Interfaces:
CredentialStore
Deprecated.
Beta Thread-safe file implementation of a credential store.
- Since:
- 1.11
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate FilePersistedCredentialsDeprecated.User credentials repository.private final FileDeprecated.File to store user credentials.private static final booleanDeprecated.private final com.google.api.client.json.JsonFactoryDeprecated.Json factory for serializing user credentials.private final LockDeprecated.Lock on access to the store.private static final LoggerDeprecated. -
Constructor Summary
ConstructorsConstructorDescriptionFileCredentialStore(File file, com.google.api.client.json.JsonFactory jsonFactory) Deprecated. -
Method Summary
Modifier and TypeMethodDescriptionvoiddelete(String userId, Credential credential) Deprecated.Deletes the credential of the given user ID.protected booleanisSymbolicLink(File file) Deprecated.Returns whether the given file is a symbolic link.booleanload(String userId, Credential credential) Deprecated.Loads the credential for the given user ID.private voidloadCredentials(File file) Deprecated.final voidmigrateTo(com.google.api.client.util.store.DataStore<StoredCredential> credentialDataStore) Deprecated.Migrates to the new format usingDataStoreofStoredCredential.final voidmigrateTo(com.google.api.client.util.store.FileDataStoreFactory dataStoreFactory) Deprecated.Migrates to the newFileDataStoreFactoryformat.private voidsave()Deprecated.voidstore(String userId, Credential credential) Deprecated.Stores the credential of the given user ID.
-
Field Details
-
LOGGER
Deprecated. -
jsonFactory
private final com.google.api.client.json.JsonFactory jsonFactoryDeprecated.Json factory for serializing user credentials. -
lock
-
credentials
-
file
-
IS_WINDOWS
private static final boolean IS_WINDOWSDeprecated.
-
-
Constructor Details
-
FileCredentialStore
public FileCredentialStore(File file, com.google.api.client.json.JsonFactory jsonFactory) throws IOException Deprecated.- Parameters:
file- File to store user credentialsjsonFactory- JSON factory to serialize user credentials- Throws:
IOException
-
-
Method Details
-
isSymbolicLink
-
store
Deprecated.Description copied from interface:CredentialStoreStores the credential of the given user ID.- Specified by:
storein interfaceCredentialStore- Parameters:
userId- user ID whose credential needs to be storedcredential- credential whoseaccess token,refresh token, andexpiration timeneed to be stored- Throws:
IOException
-
delete
Deprecated.Description copied from interface:CredentialStoreDeletes the credential of the given user ID.- Specified by:
deletein interfaceCredentialStore- Parameters:
userId- user ID whose credential needs to be deletedcredential- credential to be deleted- Throws:
IOException
-
load
Deprecated.Description copied from interface:CredentialStoreLoads the credential for the given user ID.- Specified by:
loadin interfaceCredentialStore- Parameters:
userId- user ID whose credential needs to be loadedcredential- credential whoseaccess token,refresh token, andexpiration timeneed to be set if the credential already exists in storage- Returns:
trueif the credential has been successfully found and loaded orfalseotherwise
-
loadCredentials
-
save
-
migrateTo
public final void migrateTo(com.google.api.client.util.store.FileDataStoreFactory dataStoreFactory) throws IOException Deprecated.Migrates to the newFileDataStoreFactoryformat.Sample usage:
public static FileDataStore migrate(FileCredentialStore credentialStore, File dataDirectory) throws IOException { FileDataStore dataStore = new FileDataStore(dataDirectory); credentialStore.migrateTo(dataStore); return dataStore; }- Parameters:
dataStoreFactory- file data store factory- Throws:
IOException- Since:
- 1.16
-
migrateTo
public final void migrateTo(com.google.api.client.util.store.DataStore<StoredCredential> credentialDataStore) throws IOException Deprecated.Migrates to the new format usingDataStoreofStoredCredential.- Parameters:
credentialDataStore- credential data store- Throws:
IOException- Since:
- 1.16
-
FileDataStoreFactorywithStoredCredentialinstead, optionally usingmigrateTo(FileDataStoreFactory)ormigrateTo(DataStore)to migrating an existingFileCredentialStore.