|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectedu.ucsb.nceas.morpho.datapackage.DataPackage
class that represents a data package.
Constructor Summary | |
DataPackage(java.lang.String location,
java.lang.String identifier,
java.util.Vector relations,
Morpho morpho,
boolean accessCheckFlag)
Create a new data package object with an id, location and associated relations. |
Method Summary | |
void |
checkTriplesForAccess()
|
void |
delete(java.lang.String location)
Deletes the package from the specified location |
void |
download()
Downloads a metacat package to the local disk |
void |
export(java.lang.String path)
exports a package to a given path |
void |
exportToEml2(java.lang.String path)
transforms a package to eml2; first exports the metadata |
void |
exportToZip(java.lang.String path)
Exports a package to a zip file at the given path |
java.lang.String |
getAccessFileId(java.lang.String id)
get the id of the access doc for the indicated id |
java.lang.String |
getAccessFileIdForDataPackage()
|
java.lang.String |
getAccessId()
returns the access file's id from the package |
java.util.Vector |
getAllIdentifiers()
returns a vector containing a distinct set of all of the file ids that make up this package |
java.io.File |
getAttributeFile(java.lang.String entityID)
|
java.lang.String |
getAttributeFileId(java.lang.String entityID)
|
java.util.Hashtable |
getAttributes()
returns a hashtable of vectors with the basic values in it. |
java.io.File |
getDataFile(java.lang.String entityID)
|
java.lang.String |
getDataFileID(java.lang.String entityID)
returns the ID (i.e. |
java.lang.String |
getDataFileName(java.lang.String entityID)
returns the original text name of the datafile, which for EML beta6 is contained in the triples relationship string, inside parentheses) |
java.io.File |
getFileFromId(java.lang.String id)
|
java.lang.String |
getID()
returns the id of the head of this package (i.e. |
java.lang.String |
getLocation()
returns the location of the data package. |
java.io.File |
getPhysicalFile(java.lang.String entityID)
|
java.lang.String |
getPhysicalFileId(java.lang.String entityID)
|
java.util.Hashtable |
getRelatedFiles()
returns a hashtable of the related files taken from the triples. |
org.w3c.dom.Document |
getTripleFileDom()
returns the dom representation of the triple file. |
TripleCollection |
getTriples()
gets the triplesCollection created by this object |
java.io.File |
getTriplesFile()
gets the file that contains the package information. |
boolean |
hasDataFile(java.lang.String entityID)
|
boolean |
hasMutipleVersions()
Method to determine if the this pakcage has mutiple versions |
boolean |
isDataFile(java.lang.String id)
|
boolean |
isDataFileText(java.lang.String entityID)
|
org.w3c.dom.Document |
openAsDom(java.lang.String id)
This method is needed by the XMLFactoryInterface In this case, null is always returned. |
java.io.InputStream |
openAsInputStream(java.lang.String identifier)
Open a sub-element of this datapackage (for example, a Module, or a sub-tree), given its String identifier. |
java.io.Reader |
openAsReader(java.lang.String identifier)
method to return a Reader object, which will provide access to a character-based resource. |
DataPackage |
upload()
uploads the package with the default of automatically updating the ids when a conflict occurs. |
DataPackage |
upload(boolean updateIds)
Uploads a local package to metacat |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public DataPackage(java.lang.String location, java.lang.String identifier, java.util.Vector relations, Morpho morpho, boolean accessCheckFlag)
Method Detail |
public java.io.Reader openAsReader(java.lang.String identifier) throws DocumentNotFoundException
XMLFactoryInterface
openAsReader
in interface XMLFactoryInterface
identifier
- a unique identifier used to determine what resource to return
DocumentNotFoundException
- if id does not point to a document, or
if requested document exists but cannot be accessed.public org.w3c.dom.Document openAsDom(java.lang.String id)
openAsDom
in interface XMLFactoryInterface
id
- a unique identifier used to determine what resource to returnpublic java.io.InputStream openAsInputStream(java.lang.String identifier) throws DocumentNotFoundException, java.io.FileNotFoundException
identifier
- the unique identifier needed to
locate the desired sub-element.
java.io.InputStream
to allow direct read access
to the source
DocumentNotFoundException
- if document cannot be found
java.io.FileNotFoundException
- if document cannot succesfully be
opened and an InputStream returnedpublic org.w3c.dom.Document getTripleFileDom()
public java.util.Hashtable getRelatedFiles()
public java.lang.String getLocation()
public java.util.Hashtable getAttributes()
public TripleCollection getTriples()
public java.io.File getTriplesFile()
public java.lang.String getID()
public boolean hasMutipleVersions()
public java.lang.String getAccessId() throws java.io.FileNotFoundException, java.lang.Exception, CacheAccessException
java.io.FileNotFoundException
java.lang.Exception
CacheAccessException
public java.util.Vector getAllIdentifiers()
public DataPackage upload() throws MetacatUploadException
MetacatUploadException
public DataPackage upload(boolean updateIds) throws MetacatUploadException
updateIds
- if this is true, the upload will automatically update
the ids of all of the package documents if an id conflict is found. if
it is false, a MetacatUploadException will be raised when an id conflict
occurs
MetacatUploadException
public void download()
public void delete(java.lang.String location)
public void exportToZip(java.lang.String path) throws java.lang.Exception
path
- the path to export the zip file to
java.lang.Exception
public void export(java.lang.String path)
path
- the path to which this package should be exported.public void exportToEml2(java.lang.String path)
path
- the path to which this package should be exported.public boolean isDataFile(java.lang.String id)
public boolean hasDataFile(java.lang.String entityID)
public boolean isDataFileText(java.lang.String entityID)
public java.lang.String getDataFileName(java.lang.String entityID)
entityID
- the ID of the entity for which the datafile text name is
sought
public java.io.File getPhysicalFile(java.lang.String entityID)
public java.lang.String getPhysicalFileId(java.lang.String entityID)
public java.io.File getAttributeFile(java.lang.String entityID)
public java.lang.String getAttributeFileId(java.lang.String entityID)
public java.lang.String getAccessFileId(java.lang.String id)
public java.lang.String getAccessFileIdForDataPackage()
public java.io.File getDataFile(java.lang.String entityID)
public java.lang.String getDataFileID(java.lang.String entityID)
entityID
- the ID of the entity for which the datafile ID is sought
public java.io.File getFileFromId(java.lang.String id)
public void checkTriplesForAccess()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |