public class LayeredDataElement extends AbstractDataElement implements DataElement
| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
ATTRIBUTE_DATA_ELEMENT_MISSING |
| Constructor and Description |
|---|
LayeredDataElement(LayeredDigitalObject dobj,
java.lang.String name,
DataElement top,
DataElement bottom,
java.util.concurrent.ExecutorService execServ) |
| Modifier and Type | Method and Description |
|---|---|
void |
deleteAttribute(java.lang.String aname)
Deletes a particular attribute.
|
void |
deleteAttributes(java.util.List<java.lang.String> names)
Deletes multiple attributes.
|
java.lang.String |
getAttribute(java.lang.String aname)
Returns the value for a particular attribute
|
java.util.Map<java.lang.String,java.lang.String> |
getAttributes()
Returns a Map view of the attributes of the data element.
|
DigitalObject |
getDigitalObject()
Returns the digital object of this data element.
|
java.lang.String |
getName()
Returns the name of this data element.
|
long |
getSize()
Returns the number of bytes of data in this data element.
|
java.lang.String |
getType()
Returns the MIME type of the given data.
|
CloseableIterator<java.util.Map.Entry<java.lang.String,java.lang.String>> |
listAttributes()
Returns a CloseableIterator view of the attributes of the data element.
|
java.io.InputStream |
read()
Provides access to the data as an InputStream.
|
void |
setAttribute(java.lang.String name,
java.lang.String value)
Sets a particular attribute.
|
void |
setAttributes(java.util.Map<java.lang.String,java.lang.String> attributes)
Sets the value of multiple attributes.
|
void |
setType(java.lang.String type)
Sets the MIME type of the given data.
|
long |
write(java.io.InputStream data,
boolean append)
Writes new data into the data element.
|
delete, read, writeequals, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitdelete, read, writepublic static final java.lang.String ATTRIBUTE_DATA_ELEMENT_MISSING
public LayeredDataElement(LayeredDigitalObject dobj, java.lang.String name, DataElement top, DataElement bottom, java.util.concurrent.ExecutorService execServ)
public DigitalObject getDigitalObject()
DataElementgetDigitalObject in interface DataElementpublic java.lang.String getName()
DataElementgetName in interface DataElementpublic java.util.Map<java.lang.String,java.lang.String> getAttributes()
throws RepositoryException
DataElementgetAttributes in interface DataElementgetAttributes in class AbstractDataElementRepositoryExceptionpublic CloseableIterator<java.util.Map.Entry<java.lang.String,java.lang.String>> listAttributes() throws RepositoryException
DataElementlistAttributes in interface DataElementlistAttributes in class AbstractDataElementRepositoryExceptionpublic java.lang.String getAttribute(java.lang.String aname)
throws RepositoryException
DataElementgetAttribute in interface DataElementgetAttribute in class AbstractDataElementaname - the attribute nameRepositoryExceptionpublic void setAttributes(java.util.Map<java.lang.String,java.lang.String> attributes)
throws RepositoryException
DataElementsetAttributes in interface DataElementsetAttributes in class AbstractDataElementattributes - the attributes to set, mapped to their new valuesRepositoryExceptionpublic void setAttribute(java.lang.String name,
java.lang.String value)
throws RepositoryException
DataElementsetAttribute in interface DataElementname - the attribute namevalue - the attribute value; if null, the attribute will be deleted.RepositoryExceptionpublic void deleteAttributes(java.util.List<java.lang.String> names)
throws RepositoryException
DataElementdeleteAttributes in interface DataElementdeleteAttributes in class AbstractDataElementnames - the names of the attributes to deleteRepositoryExceptionpublic void deleteAttribute(java.lang.String aname)
throws RepositoryException
DataElementdeleteAttribute in interface DataElementaname - the name of the attribute to deleteRepositoryExceptionpublic java.lang.String getType()
throws RepositoryException
DataElementgetType in interface DataElementgetType in class AbstractDataElementRepositoryExceptionpublic void setType(java.lang.String type)
throws RepositoryException
DataElementsetType in interface DataElementsetType in class AbstractDataElementtype - the new MIME typeRepositoryExceptionpublic java.io.InputStream read()
throws RepositoryException
DataElementread in interface DataElementRepositoryExceptionpublic long write(java.io.InputStream data,
boolean append)
throws java.io.IOException,
RepositoryException
DataElementwrite in interface DataElementdata - an InputStream streaming the new dataappend - whether to append the new data to the existing datajava.io.IOExceptionRepositoryExceptionpublic long getSize()
throws RepositoryException
DataElementgetSize in interface DataElementRepositoryException