Package com.google.api.client.util.store
Class FileDataStoreFactory.FileDataStore<V extends java.io.Serializable>
- java.lang.Object
-
- com.google.api.client.util.store.AbstractDataStore<V>
-
- com.google.api.client.util.store.AbstractMemoryDataStore<V>
-
- com.google.api.client.util.store.FileDataStoreFactory.FileDataStore<V>
-
- Type Parameters:
V
- serializable type of the mapped value
- All Implemented Interfaces:
DataStore<V>
- Enclosing class:
- FileDataStoreFactory
static class FileDataStoreFactory.FileDataStore<V extends java.io.Serializable> extends AbstractMemoryDataStore<V>
File data store that inherits from the abstract memory data store because the key-value pairs are stored in a memory cache, and saved in the file (seesave()
when changing values.
-
-
Field Summary
Fields Modifier and Type Field Description private java.io.File
dataFile
File to store data.-
Fields inherited from class com.google.api.client.util.store.AbstractMemoryDataStore
keyValueMap
-
-
Constructor Summary
Constructors Constructor Description FileDataStore(FileDataStoreFactory dataStore, java.io.File dataDirectory, java.lang.String id)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description FileDataStoreFactory
getDataStoreFactory()
Returns the data store factory.(package private) void
save()
Persist the key-value map into storage at the end ofAbstractMemoryDataStore.set(java.lang.String, V)
,AbstractMemoryDataStore.delete(String)
, andAbstractMemoryDataStore.clear()
.-
Methods inherited from class com.google.api.client.util.store.AbstractMemoryDataStore
clear, containsKey, containsValue, delete, get, isEmpty, keySet, set, size, toString, values
-
Methods inherited from class com.google.api.client.util.store.AbstractDataStore
getId
-
-
-
-
Constructor Detail
-
FileDataStore
FileDataStore(FileDataStoreFactory dataStore, java.io.File dataDirectory, java.lang.String id) throws java.io.IOException
- Throws:
java.io.IOException
-
-
Method Detail
-
save
void save() throws java.io.IOException
Description copied from class:AbstractMemoryDataStore
Persist the key-value map into storage at the end ofAbstractMemoryDataStore.set(java.lang.String, V)
,AbstractMemoryDataStore.delete(String)
, andAbstractMemoryDataStore.clear()
.- Overrides:
save
in classAbstractMemoryDataStore<V extends java.io.Serializable>
- Throws:
java.io.IOException
-
getDataStoreFactory
public FileDataStoreFactory getDataStoreFactory()
Description copied from class:AbstractDataStore
Returns the data store factory.Overriding is only supported for the purpose of calling the super implementation and changing the return type, but nothing else.
- Specified by:
getDataStoreFactory
in interfaceDataStore<V extends java.io.Serializable>
- Overrides:
getDataStoreFactory
in classAbstractDataStore<V extends java.io.Serializable>
-
-