Class FileSystemDataStore
java.lang.Object
org.moeaframework.analysis.store.fs.FileSystemDataStore
- All Implemented Interfaces:
DataStore
Data store backed by the local file system. If the data store already exists, the settings are loaded from a
manifest file and arguments passed to the constructor are ignored.
The layout of containers and blobs on the file system are managed by a FileMap, which defaults to
HierarchicalFileMap if not specified.
-
Constructor Summary
ConstructorsConstructorDescriptionFileSystemDataStore(File root) Constructs a default file system data store at the specified directory.FileSystemDataStore(File root, FileMap fileMap) Constructs a default file system data store at the specified directory.FileSystemDataStore(Path root) Constructs a default file system data store at the specified directory.FileSystemDataStore(Path root, FileMap fileMap) Constructs a hierarchical file system data store at the specified directory. -
Method Summary
Modifier and TypeMethodDescriptionvoidcreate()Creates the underlying, physical data store.booleandelete()Deletes this data store if it exists, including all containers and blobs contained within.booleanexists()Returnstrueif the underlying, physical data store exists.getContainer(Reference key) Returns the container for the given reference.Returns the application intent that specifies what operations are valid against a data store.getURI()Returns the URI for this data store, which can be used withDataStoreFactory.getDataStore(java.net.URI).voidSets the application intent that specifies what operations are valid against a data store.Returns a stream of all containers, excluding the root container, in this data store.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.moeaframework.analysis.store.DataStore
getContainer, getRootContainer, listContainers, toJSON, toJSON, toJSON
-
Constructor Details
-
FileSystemDataStore
Constructs a default file system data store at the specified directory.- Parameters:
root- the root directory- Throws:
DataStoreException- if an error occurred accessing the data store
-
FileSystemDataStore
Constructs a default file system data store at the specified directory.- Parameters:
root- the root directory- Throws:
DataStoreException- if an error occurred accessing the data store
-
FileSystemDataStore
Constructs a default file system data store at the specified directory.- Parameters:
root- the root directoryfileMap- the file map used when creating a new data store; otherwise the map is read from the manifest- Throws:
DataStoreException- if an error occurred accessing the data store
-
FileSystemDataStore
Constructs a hierarchical file system data store at the specified directory.- Parameters:
root- the root directoryfileMap- the file map used when creating a new data store; otherwise the map is read from the manifest- Throws:
DataStoreException- if an error occurred accessing the data store
-
-
Method Details
-
getContainer
Description copied from interface:DataStoreReturns the container for the given reference. A container is always returned, though this does not imply the underlying storage exists or has been provisioned.- Specified by:
getContainerin interfaceDataStore- Parameters:
key- the data reference- Returns:
- the container
-
streamContainers
Description copied from interface:DataStoreReturns a stream of all containers, excluding the root container, in this data store. The caller must close the stream when finished.- Specified by:
streamContainersin interfaceDataStore- Returns:
- a stream of containers
- Throws:
DataStoreException- if an error occurred accessing the data store
-
getURI
Description copied from interface:DataStoreReturns the URI for this data store, which can be used withDataStoreFactory.getDataStore(java.net.URI). -
getIntent
Description copied from interface:DataStoreReturns the application intent that specifies what operations are valid against a data store.- Specified by:
getIntentin interfaceDataStore- Returns:
- the application intent
- Throws:
DataStoreException- if an error occurred accessing the data store
-
setIntent
Description copied from interface:DataStoreSets the application intent that specifies what operations are valid against a data store.- Specified by:
setIntentin interfaceDataStore- Parameters:
intent- the application intent- Throws:
DataStoreException- if an error occurred accessing the data store
-
exists
Description copied from interface:DataStoreReturnstrueif the underlying, physical data store exists.- Specified by:
existsin interfaceDataStore- Returns:
trueif the data store exists;falseotherwise- Throws:
DataStoreException- if an error occurred accessing the data store
-
delete
Description copied from interface:DataStoreDeletes this data store if it exists, including all containers and blobs contained within.- Specified by:
deletein interfaceDataStore- Returns:
trueif the data store was deleted;falseotherwise- Throws:
DataStoreException- if an error occurred accessing the data store
-
create
Creates the underlying, physical data store. Data stores are automatically created when writing a blob, so an explicit call to create is not required.- Throws:
DataStoreException- if an error occurred accessing the data store
-