Class FileCredentialStore
- java.lang.Object
-
- com.google.api.client.extensions.java6.auth.oauth2.FileCredentialStore
-
- All Implemented Interfaces:
CredentialStore
@Deprecated @Beta public class FileCredentialStore extends Object implements CredentialStore
Deprecated.(to be removed in the future) UseFileDataStoreFactorywithStoredCredentialinstead, optionally usingmigrateTo(FileDataStoreFactory)ormigrateTo(DataStore)to migrating an existingFileCredentialStore.Beta
Thread-safe file implementation of a credential store.- Since:
- 1.11
- Author:
- Rafael Naufal
-
-
Constructor Summary
Constructors Constructor Description FileCredentialStore(File file, com.google.api.client.json.JsonFactory jsonFactory)Deprecated.
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description voiddelete(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.voidmigrateTo(com.google.api.client.util.store.DataStore<StoredCredential> credentialDataStore)Deprecated.Migrates to the new format usingDataStoreofStoredCredential.voidmigrateTo(com.google.api.client.util.store.FileDataStoreFactory dataStoreFactory)Deprecated.Migrates to the newFileDataStoreFactoryformat.voidstore(String userId, Credential credential)Deprecated.Stores the credential of the given user ID.
-
-
-
Constructor Detail
-
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 Detail
-
isSymbolicLink
protected boolean isSymbolicLink(File file) throws IOException
Deprecated.Returns whether the given file is a symbolic link.- Throws:
IOException- Since:
- 1.13
-
store
public void store(String userId, Credential credential) throws IOException
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
public void delete(String userId, Credential credential) throws IOException
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
public boolean load(String userId, Credential credential)
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
-
migrateTo
public final void migrateTo(com.google.api.client.util.store.FileDataStoreFactory dataStoreFactory) throws IOExceptionDeprecated.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
-
-