edu.ucsb.nceas.morpho.framework
Class MetacatDataStore
java.lang.Object
|
+--edu.ucsb.nceas.morpho.framework.DataStore
|
+--edu.ucsb.nceas.morpho.framework.MetacatDataStore
- public class MetacatDataStore
- extends DataStore
- implements DataStoreInterface
implements and the DataStoreInterface for accessing files on the Metacat
Method Summary |
boolean |
deleteFile(java.lang.String name)
deletes a file from metacat. |
static void |
main(java.lang.String[] args)
Test method |
void |
newDataFile(java.lang.String id,
java.io.File file)
method to create a new data file on metacat. |
java.io.File |
newFile(java.lang.String name,
java.io.Reader file,
boolean publicAccess)
Create and save a new file to metacat using the "insert" action. |
java.io.File |
openFile(java.lang.String name)
Opens a file from Metacat and returns a File object that represents the
metacat file. |
java.io.File |
saveFile(java.lang.String name,
java.io.Reader file,
boolean publicAccess)
Save an xml metadata file (which already exists) to metacat using the
"update" action. |
Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
MetacatDataStore
public MetacatDataStore(ClientFramework cf)
- Constructor to create this object in conjunction with a ceartain framework.
openFile
public java.io.File openFile(java.lang.String name)
throws java.io.FileNotFoundException,
CacheAccessException
- Opens a file from Metacat and returns a File object that represents the
metacat file. If the file does not exist in the local cache, or is
outdated in the local cache, this method adds the new file to the cache
for later access.
- Specified by:
- openFile in interface DataStoreInterface
- Overrides:
- openFile in class DataStore
- Parameters:
name:
- the docid of the metacat file in <scope>.<number>
or <scope>.<number>.<revision> form.
saveFile
public java.io.File saveFile(java.lang.String name,
java.io.Reader file,
boolean publicAccess)
throws MetacatUploadException
- Save an xml metadata file (which already exists) to metacat using the
"update" action.
This method is for xml metadata documents only do not use this method to
upload binary data files.
- Specified by:
- saveFile in interface DataStoreInterface
- Overrides:
- saveFile in class DataStore
- Parameters:
name:
- the docidfile:
- the file to savepublicAccess:
- true if the file can be read by unauthenticated
users, false otherwise.
newFile
public java.io.File newFile(java.lang.String name,
java.io.Reader file,
boolean publicAccess)
throws MetacatUploadException
- Create and save a new file to metacat using the "insert" action.
- Specified by:
- newFile in interface DataStoreInterface
- Overrides:
- newFile in class DataStore
- Parameters:
name:
- the id of the new filefile:
- the stream to the file to write to metacatpublicAccess:
- flag for unauthenticated read access to the new file
true if unauthenticated users should have read access, false otherwise
newDataFile
public void newDataFile(java.lang.String id,
java.io.File file)
throws MetacatUploadException
- method to create a new data file on metacat. This method uploads the
given file with the given id. It does nothing to control access or
link the file into packages -- those items are handled by the metadata
documents that are created on metacat.
- Parameters:
id
- the identifier to use for this file (e.g., knb.1.1). It should be
revision '1' because data files cannot be updated on metacatfile
- the file to upload to metacat
deleteFile
public boolean deleteFile(java.lang.String name)
- deletes a file from metacat. returns true if the file was deleted
succesfully, false otherwise.
- Specified by:
- deleteFile in interface DataStoreInterface
- Overrides:
- deleteFile in class DataStore
- Parameters:
name
- the name of the file to delete
main
public static void main(java.lang.String[] args)
- Test method
Copyright © 2000 National Center for Ecological Analysis and Synthesis. All Rights Reserved.