Interface ResourceOnFileSystem

All Superinterfaces:
Resource
All Known Implementing Classes:
AsciiGridStore, DataCube, ImageFileDirectory, MultiImageStore, MultiImageStore.Writable, MultiResolutionImage, PRJDataStore, RasterStore, RawRasterStore, SingleImageStore, SingleImageStore.Writable, StaxDataStore, Store, Store, Store, Store, URIDataStore, WorldFileStore, WritableStore, WritableStore, WritableStore

public interface ResourceOnFileSystem extends Resource
A resource which is loaded from one or many files on an arbitrary file system. This interface allows a resource (typically a data store) to list the files that it uses. It may be used for copying or deleting resources if the caller is certain that those files are not in use.

Alternatives

For copying data from one location to another, consider using WritableAggregate.add(Resource) instead. The data store implementations may detect that some add(…) operations can be performed by verbatim copy of files.

For deleting data, consider using WritableAggregate.remove(Resource) instead.

Since:
1.0
Version:
1.0
  • Method Details

    • getComponentFiles

      Path[] getComponentFiles() throws DataStoreException
      Gets the paths to files potentially used by this resource. This is typically the files opened by a data store. There is no guarantee that all files are in the same directory or that each file is used exclusively by this data source (e.g. no guarantee that modifying or deleting a file will not impact other resources).
      Example: a resources created for a GRIB file may use the following component files:
      • The main GRIB file.
      • If managed by the UCAR library, two auxiliary files next to the main GRIB file: the index file (".gbx9") and the collection file (".ncx"). Those two files are owned exclusively by the resource.
      • Eventually a GRIB table file. This table may be located in a path unrelated to to the path of the main file and may be shared by many resources.
      This method should return paths to files only. It should not return paths to directories. The caller should verify that all paths are regular files; non-existent paths should be omitted.
      Returns:
      files used by this resource. Should never be null.
      Throws:
      DataStoreException - if an error on the file system prevent the creation of the list.