|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--edu.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 |
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.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)
|
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)
location:
- the location of the file ('METACAT' or 'LOCAL')identifier:
- the id of the data package. usually the id of the
file that contains the triples.relations:
- a vector of all relations in this package.morpho:
- reference to the main Morpho application.Method Detail |
public java.io.Reader openAsReader(java.lang.String identifier) throws DocumentNotFoundException
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 sourcepublic 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
public java.util.Vector getAllIdentifiers()
public DataPackage upload() throws 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
occurspublic void download()
public void delete(java.lang.String location)
locattion
- the location of the package that you want to delete
use either DataPackageInterface.BOTH, DataPackageInterface.METACAT or DataPackageInterface.LOCALpublic void exportToZip(java.lang.String path) throws java.lang.Exception
path
- the path to export the zip file topublic void export(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
soughtpublic 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 soughtpublic void checkTriplesForAccess()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |