edu.ucsb.nceas.morpho.datapackage
Class DataPackage

java.lang.Object
  |
  +--edu.ucsb.nceas.morpho.datapackage.DataPackage

public class DataPackage
extends java.lang.Object

class that represents a data package.


Field Summary
static java.lang.String BOTH
          used to signify that this package is stored on metacat and locally.
static java.lang.String LOCAL
          used to signify that this package is located locally
static java.lang.String METACAT
          used to signify that this package is located on a metacat server
 
Constructor Summary
DataPackage(java.lang.String location, java.lang.String identifier, java.util.Vector relations, ClientFramework framework)
          Create a new data package object with an id, location and associated relations.
 
Method Summary
 void delete(java.lang.String location)
          Deletes the package from the specified location
 void download()
          Downloads a metacat package to the local disk
 java.util.Vector getAllIdentifiers()
          returns a vector containing a distinct set of all of the file ids that make up this package
 java.util.Hashtable getAttributes()
          returns a hashtable of vectors with the basic values in it.
 java.lang.String getID()
          returns the id of the head of this package (i.e.
 java.lang.String getIdentifier()
          gets the identifier of the package file
 java.lang.String getLocation()
          returns the location of the data package.
 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.
 void upload()
          Uploads a local package to metacat
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

METACAT

public static final java.lang.String METACAT
used to signify that this package is located on a metacat server

LOCAL

public static final java.lang.String LOCAL
used to signify that this package is located locally

BOTH

public static final java.lang.String BOTH
used to signify that this package is stored on metacat and locally.
Constructor Detail

DataPackage

public DataPackage(java.lang.String location,
                   java.lang.String identifier,
                   java.util.Vector relations,
                   ClientFramework framework)
Create a new data package object with an id, location and associated relations.
Parameters:
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.
Method Detail

getLocation

public java.lang.String getLocation()
returns the location of the data package. Either this.METACAT or this.LOCAL.

getID

public java.lang.String getID()
returns the id of the head of this package (i.e. the resource file)

getTripleFileDom

public org.w3c.dom.Document getTripleFileDom()
returns the dom representation of the triple file.

getRelatedFiles

public java.util.Hashtable getRelatedFiles()
returns a hashtable of the related files taken from the triples. These are organized so that the key of the hashtable is the type of metadata (e.g. 'Entity') and the value of the hashtable is a vector of docids

getAttributes

public java.util.Hashtable getAttributes()
returns a hashtable of vectors with the basic values in it. Currently, the basic values for the package editor are title, altTitle and originators

getTriples

public TripleCollection getTriples()
gets the triplesCollection created by this object

getTriplesFile

public java.io.File getTriplesFile()
gets the file that contains the package information.

getIdentifier

public java.lang.String getIdentifier()
gets the identifier of the package file

getAllIdentifiers

public java.util.Vector getAllIdentifiers()
returns a vector containing a distinct set of all of the file ids that make up this package

upload

public void upload()
Uploads a local package to metacat

download

public void download()
Downloads a metacat package to the local disk

delete

public void delete(java.lang.String location)
Deletes the package from the specified location
Parameters:
locattion - the location of the package that you want to delete use either DataPackage.BOTH, DataPackage.METACAT or DataPackage.LOCAL


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