Package com.google.api.client.util.store
Class FileDataStoreFactory
- java.lang.Object
-
- com.google.api.client.util.store.AbstractDataStoreFactory
-
- com.google.api.client.util.store.FileDataStoreFactory
-
- All Implemented Interfaces:
DataStoreFactory
public class FileDataStoreFactory extends AbstractDataStoreFactory
Thread-safe file implementation of a credential store.For security purposes, the file's permissions are set to be accessible only by the file's owner. Note that Java 1.5 does not support manipulating file permissions, and must be done manually or using the JNI.
- Since:
- 1.16
- Author:
- Yaniv Inbar
-
-
Constructor Summary
Constructors Constructor Description FileDataStoreFactory(File dataDirectory)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected <V extends Serializable>
DataStore<V>createDataStore(String id)
Returns a new instance of a type-specific data store based on the given unique ID.File
getDataDirectory()
Returns the data directory.-
Methods inherited from class com.google.api.client.util.store.AbstractDataStoreFactory
getDataStore
-
-
-
-
Constructor Detail
-
FileDataStoreFactory
public FileDataStoreFactory(File dataDirectory) throws IOException
- Parameters:
dataDirectory
- data directory- Throws:
IOException
-
-
Method Detail
-
getDataDirectory
public final File getDataDirectory()
Returns the data directory.
-
createDataStore
protected <V extends Serializable> DataStore<V> createDataStore(String id) throws IOException
Description copied from class:AbstractDataStoreFactory
Returns a new instance of a type-specific data store based on the given unique ID.The
DataStore.getId()
must match theid
parameter from this method.- Specified by:
createDataStore
in classAbstractDataStoreFactory
- Type Parameters:
V
- serializable type of the mapped value- Parameters:
id
- unique ID to refer to typed data store- Throws:
IOException
-
-