public abstract class PrimaryDataFile extends PrimaryDataEntity
Abstract PrimaryDataFile class.
| Modifier | Constructor and Description |
|---|---|
protected |
PrimaryDataFile()
Default constructor create a
PrimaryDataFile |
|
PrimaryDataFile(PrimaryDataDirectory path,
String name)
Construct a
PrimaryDataFile and set the file version to the
latest one |
| Modifier and Type | Method and Description |
|---|---|
protected abstract boolean |
existData()
Abstract function to check if the current
PrimaryDataEntityVersion of this PrimaryDataFile has
stored data. |
void |
read(OutputStream dataOutputStream)
Load the data of the latest
PrimaryDataEntityVersion of this
PrimaryDataFile as stream. |
protected abstract void |
readImpl(OutputStream dataOutputStream)
Abstract function for implementation the
read(OutputStream) function. |
void |
setMetaData(MetaData newMetadata)
Setter for the
MetaData object of this PrimaryDataEntity
object. |
void |
store(InputStream dataInputStream)
Store data and generate a new
PrimaryDataEntityVersion for this
PrimaryDataFile. |
protected abstract void |
storeImpl(InputStream dataInputStream,
PrimaryDataEntityVersion newFileVersion)
Abstract function for implementation the
store(InputStream) function. |
addPublicReference, commitVersion, compareTo, delete, equals, getCurrentVersion, getID, getImplementationProvider, getMetaData, getName, getParentDirectory, getPath, getPermissions, getPermissionsImpl, getPublicReferences, getSubject, getVersionByDate, getVersionByRevisionNumber, getVersions, getVersionsImpl, grantPermission, hashCode, isDirectory, move, moveImpl, reloadOldDataType, rename, revokePermission, setCurrentVersion, setDefaultPermissions, setID, setParentDirectory, storeVersion, switchCurrentVersion, toStringprotected PrimaryDataFile()
PrimaryDataFilepublic PrimaryDataFile(PrimaryDataDirectory path, String name) throws PrimaryDataFileException, PrimaryDataEntityVersionException, PrimaryDataDirectoryException, MetaDataException
PrimaryDataFile and set the file version to the
latest onepath - the directory of the filename - the file namePrimaryDataFileException - if unable to set data type.PrimaryDataEntityVersionException - if unable to store initial version.PrimaryDataDirectoryException - if no parent PrimaryDataDirectory is found.MetaDataException - if the MetaData object of the parent
PrimaryDataDirectory is not clone-able.protected abstract boolean existData()
PrimaryDataEntityVersion of this PrimaryDataFile has
stored data.true if the current PrimaryDataEntityVersion
has stored data;false otherwise.public void read(OutputStream dataOutputStream) throws PrimaryDataFileException
PrimaryDataEntityVersion of this
PrimaryDataFile as stream.dataOutputStream - the loaded data.PrimaryDataFileException - if no data is stored.protected abstract void readImpl(OutputStream dataOutputStream) throws PrimaryDataFileException
read(OutputStream) function.dataOutputStream - the loaded data.PrimaryDataFileException - if no data is stored.public void setMetaData(MetaData newMetadata) throws PrimaryDataEntityVersionException, MetaDataException
MetaData object of this PrimaryDataEntity
object.
Create a new PrimaryDataEntityVersion with a new MetaData
set.
Check before if the EnumDublinCoreElements.TYPE is not a
MetaData.DIRECTORY object.
setMetaData in class PrimaryDataEntitynewMetadata - the new MetaData object to set.PrimaryDataEntityVersionException - if unable to store PrimaryDataEntityVersion.MetaDataException - if there are non valid value for element in the
MetaData object.public void store(InputStream dataInputStream) throws PrimaryDataFileException, PrimaryDataEntityVersionException
PrimaryDataEntityVersion for this
PrimaryDataFile.dataInputStream - the date to store in this PrimaryDataEntityVersion.PrimaryDataFileException - if storing of data fails.PrimaryDataEntityVersionException - if provided version conflicts with existing versions.protected abstract void storeImpl(InputStream dataInputStream, PrimaryDataEntityVersion newFileVersion) throws PrimaryDataFileException
store(InputStream) function.dataInputStream - the date to store in this PrimaryDataEntityVersionPrimaryDataFileException - if storing of data failsPrimaryDataEntityVersionException - if provided version conflicts with existing versionsCopyright © 2015 Leibniz Institute of Plant Genetics and Crop Plant Research (IPK). All rights reserved.