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 FilePersistedCredentials
Deprecated.User credentials repository.private final File
Deprecated.File to store user credentials.private static final boolean
Deprecated.private final com.google.api.client.json.JsonFactory
Deprecated.Json factory for serializing user credentials.private final Lock
Deprecated.Lock on access to the store.private static final Logger
Deprecated. -
Constructor Summary
ConstructorsConstructorDescriptionFileCredentialStore
(File file, com.google.api.client.json.JsonFactory jsonFactory) Deprecated. -
Method Summary
Modifier and TypeMethodDescriptionvoid
delete
(String userId, Credential credential) Deprecated.Deletes the credential of the given user ID.protected boolean
isSymbolicLink
(File file) Deprecated.Returns whether the given file is a symbolic link.boolean
load
(String userId, Credential credential) Deprecated.Loads the credential for the given user ID.private void
loadCredentials
(File file) Deprecated.final void
migrateTo
(com.google.api.client.util.store.DataStore<StoredCredential> credentialDataStore) Deprecated.Migrates to the new format usingDataStore
ofStoredCredential
.final void
migrateTo
(com.google.api.client.util.store.FileDataStoreFactory dataStoreFactory) Deprecated.Migrates to the newFileDataStoreFactory
format.private void
save()
Deprecated.void
store
(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
Deprecated.Lock on access to the store. -
credentials
Deprecated.User credentials repository. -
file
Deprecated.File to store user credentials. -
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
Deprecated.Returns whether the given file is a symbolic link.- Throws:
IOException
- Since:
- 1.13
-
store
Deprecated.Description copied from interface:CredentialStore
Stores the credential of the given user ID.- Specified by:
store
in interfaceCredentialStore
- Parameters:
userId
- user ID whose credential needs to be storedcredential
- credential whoseaccess token
,refresh token
, andexpiration time
need to be stored- Throws:
IOException
-
delete
Deprecated.Description copied from interface:CredentialStore
Deletes the credential of the given user ID.- Specified by:
delete
in interfaceCredentialStore
- Parameters:
userId
- user ID whose credential needs to be deletedcredential
- credential to be deleted- Throws:
IOException
-
load
Deprecated.Description copied from interface:CredentialStore
Loads the credential for the given user ID.- Specified by:
load
in interfaceCredentialStore
- Parameters:
userId
- user ID whose credential needs to be loadedcredential
- credential whoseaccess token
,refresh token
, andexpiration time
need to be set if the credential already exists in storage- Returns:
true
if the credential has been successfully found and loaded orfalse
otherwise
-
loadCredentials
Deprecated.- Throws:
IOException
-
save
Deprecated.- Throws:
IOException
-
migrateTo
public final void migrateTo(com.google.api.client.util.store.FileDataStoreFactory dataStoreFactory) throws IOException Deprecated.Migrates to the newFileDataStoreFactory
format.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 usingDataStore
ofStoredCredential
.- Parameters:
credentialDataStore
- credential data store- Throws:
IOException
- Since:
- 1.16
-
FileDataStoreFactory
withStoredCredential
instead, optionally usingmigrateTo(FileDataStoreFactory)
ormigrateTo(DataStore)
to migrating an existingFileCredentialStore
.