Class FileSystemDataStore

java.lang.Object
org.moeaframework.analysis.store.fs.FileSystemDataStore
All Implemented Interfaces:
DataStore

public class FileSystemDataStore extends Object implements DataStore
Data store backed by the local file system. A FileMap determines the layout of the containers and blobs. Unless otherwise specified, HashFileMap is used.
  • Constructor Details

    • FileSystemDataStore

      public FileSystemDataStore(File root) throws IOException
      Constructs a default file system data store at the specified directory.
      Parameters:
      root - the root directory
      Throws:
      IOException - if an I/O error occurred
      ManifestValidationException - if the existing manifest failed validation
    • FileSystemDataStore

      public FileSystemDataStore(File root, Schema schema) throws IOException
      Constructs a default file system data store at the specified directory.
      Parameters:
      root - the root directory
      schema - the schema defining the structure of the data store
      Throws:
      IOException - if an I/O error occurred
      ManifestValidationException - if the existing manifest failed validation
    • FileSystemDataStore

      public FileSystemDataStore(File root, FileMap fileMap) throws IOException
      Constructs a file system data store at the specified directory.
      Parameters:
      root - the root directory
      fileMap - the file map that determines the layout of files
      Throws:
      IOException - if an I/O error occurred
      ManifestValidationException - if the existing manifest failed validation
    • FileSystemDataStore

      public FileSystemDataStore(Path root, FileMap fileMap, Schema schema) throws IOException
      Constructs a hierarchical file system data store at the specified directory.
      Parameters:
      root - the root directory
      fileMap - the file map that determines the layout of files
      schema - the schema defining the structure of the data store
      Throws:
      IOException - if an I/O error occurred
      ManifestValidationException - if the existing manifest failed validation
  • Method Details

    • getSchema

      public Schema getSchema()
      Returns the schema used by this file store.
      Returns:
      the schema
    • getRoot

      public Path getRoot()
      Returns the root directory for this data store.
      Returns:
      the root directory
    • getContainer

      public Container getContainer(Reference key)
      Description copied from interface: DataStore
      Returns 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:
      getContainer in interface DataStore
      Parameters:
      key - the data reference
      Returns:
      the container
    • listContainers

      public List<Container> listContainers() throws IOException
      Description copied from interface: DataStore
      Returns a list of all containers in this data store.
      Specified by:
      listContainers in interface DataStore
      Returns:
      a list of containers
      Throws:
      IOException - if an I/O error occurred