public class FileCredentialStore implements CredentialStoreDeprecated. (to be removed in the future) Use FileDataStoreFactory with StoredCredential instead, optionally using #migrateTo(FileDataStoreFactory) or #migrateTo(DataStore) to migrating an existing FileCredentialStore.
Beta
Thread-safe file implementation of a credential store.
Implements
CredentialStoreConstructors
FileCredentialStore(File file, JsonFactory jsonFactory) (deprecated)
public FileCredentialStore(File file, JsonFactory jsonFactory)| Name | Description |
| file | FileFile to store user credentials |
| jsonFactory | com.google.api.client.json.JsonFactoryJSON factory to serialize user credentials |
Methods
delete(String userId, Credential credential) (deprecated)
public void delete(String userId, Credential credential)Deletes the credential of the given user ID.
| Name | Description |
| userId | String |
| credential | Credential |
| Type | Description |
| IOException |
isSymbolicLink(File file) (deprecated)
protected boolean isSymbolicLink(File file)Returns whether the given file is a symbolic link.
| Name | Description |
| file | File |
| Type | Description |
| boolean |
| Type | Description |
| IOException |
load(String userId, Credential credential) (deprecated)
public boolean load(String userId, Credential credential)Loads the credential for the given user ID.
| Name | Description |
| userId | String |
| credential | Credential |
| Type | Description |
| boolean |
migrateTo(DataStore<StoredCredential> credentialDataStore) (deprecated)
public final void migrateTo(DataStore<StoredCredential> credentialDataStore)Migrates to the new format using DataStore of StoredCredential.
| Name | Description |
| credentialDataStore | com.google.api.client.util.store.DataStore<StoredCredential>credential data store |
| Type | Description |
| IOException |
migrateTo(FileDataStoreFactory dataStoreFactory) (deprecated)
public final void migrateTo(FileDataStoreFactory dataStoreFactory)Migrates to the new FileDataStoreFactory format.
Sample usage:
public static FileDataStore migrate(FileCredentialStore credentialStore, File dataDirectory) throws IOException { FileDataStore dataStore = new FileDataStore(dataDirectory); credentialStore.migrateTo(dataStore); return dataStore; }
| Name | Description |
| dataStoreFactory | com.google.api.client.util.store.FileDataStoreFactoryfile data store factory |
| Type | Description |
| IOException |
store(String userId, Credential credential) (deprecated)
public void store(String userId, Credential credential)Stores the credential of the given user ID.
| Name | Description |
| userId | String |
| credential | Credential |
| Type | Description |
| IOException |