edu.ucsb.nceas.morpho.datastore
Interface DataStoreInterface

All Known Implementing Classes:
DataStore, FileSystemDataStore, MetacatDataStore

public interface DataStoreInterface

creates an interface for getting files from any dataStore using the same methods.


Method Summary
 boolean deleteFile(java.lang.String name)
          Deletes the file with an id of name.
 java.io.File newFile(java.lang.String name, java.io.Reader file, DataPackage dp)
          create a new file with an id of name in the datastore and return a File object that represents it.
 java.io.File openFile(java.lang.String name)
          open a file from a datastore with the id of name and return a File object that represents it.
 java.io.File saveFile(java.lang.String name, java.io.Reader file, DataPackage dp)
          save a file to the datastore with the id of name.
 

Method Detail

openFile

public java.io.File openFile(java.lang.String name)
                      throws java.io.FileNotFoundException,
                             CacheAccessException
open a file from a datastore with the id of name and return a File object that represents it. Throws FileNotFoundException if a file with the id name does not exist in the datastore. Throws IOException if a there is a communications problem with the datastore.

saveFile

public java.io.File saveFile(java.lang.String name,
                             java.io.Reader file,
                             DataPackage dp)
                      throws java.lang.Exception
save a file to the datastore with the id of name. a file object representing the saved file is returned. If the publicAccess boolean is true, then an unauthenticated user may read the document from the data store.

newFile

public java.io.File newFile(java.lang.String name,
                            java.io.Reader file,
                            DataPackage dp)
                     throws java.lang.Exception
create a new file with an id of name in the datastore and return a File object that represents it.

deleteFile

public boolean deleteFile(java.lang.String name)
                   throws java.lang.Exception
Deletes the file with an id of name. returns true if the file was succesfully deleted, false otherwise


Copyright © 2000 National Center for Ecological Analysis and Synthesis. All Rights Reserved.