Class FileCredentialStore (1.32.1)

public class FileCredentialStore implements CredentialStore

(deprecated) (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.

Inheritance

java.lang.Object > FileCredentialStore

Implements

CredentialStore

Constructors

FileCredentialStore(File file, JsonFactory jsonFactory) (deprecated)

public FileCredentialStore(File file, JsonFactory jsonFactory)
Parameters
NameDescription
fileFile

File to store user credentials

jsonFactorycom.google.api.client.json.JsonFactory

JSON 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.

Parameters
NameDescription
userIdString
credentialCredential
Exceptions
TypeDescription
IOException
protected boolean isSymbolicLink(File file)

Returns whether the given file is a symbolic link.

Parameter
NameDescription
fileFile
Returns
TypeDescription
boolean
Exceptions
TypeDescription
IOException

load(String userId, Credential credential) (deprecated)

public boolean load(String userId, Credential credential)

Loads the credential for the given user ID.

Parameters
NameDescription
userIdString
credentialCredential
Returns
TypeDescription
boolean

migrateTo(DataStore<StoredCredential> credentialDataStore) (deprecated)

public final void migrateTo(DataStore<StoredCredential> credentialDataStore)

Migrates to the new format using DataStore of StoredCredential.

Parameter
NameDescription
credentialDataStorecom.google.api.client.util.store.DataStore<StoredCredential>

credential data store

Exceptions
TypeDescription
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; }

Parameter
NameDescription
dataStoreFactorycom.google.api.client.util.store.FileDataStoreFactory

file data store factory

Exceptions
TypeDescription
IOException

store(String userId, Credential credential) (deprecated)

public void store(String userId, Credential credential)

Stores the credential of the given user ID.

Parameters
NameDescription
userIdString
credentialCredential
Exceptions
TypeDescription
IOException