public interface DataElement
Modifier and Type | Method and Description |
---|---|
void |
delete()
Deletes the data element from its digital object.
|
void |
deleteAttribute(java.lang.String name)
Deletes a particular attribute.
|
void |
deleteAttributes(java.util.List<java.lang.String> names)
Deletes multiple attributes.
|
java.lang.String |
getAttribute(java.lang.String name)
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.
|
java.io.InputStream |
read(long start,
long len)
Provides access to a specified portion of 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)
Writes new data into the data element.
|
long |
write(java.io.InputStream data,
boolean append)
Writes new data into the data element.
|
DigitalObject getDigitalObject()
java.lang.String getName()
void delete() throws RepositoryException
RepositoryException
java.util.Map<java.lang.String,java.lang.String> getAttributes() throws RepositoryException
RepositoryException
CloseableIterator<java.util.Map.Entry<java.lang.String,java.lang.String>> listAttributes() throws RepositoryException
RepositoryException
java.lang.String getAttribute(java.lang.String name) throws RepositoryException
name
- the attribute nameRepositoryException
void setAttributes(java.util.Map<java.lang.String,java.lang.String> attributes) throws RepositoryException
attributes
- the attributes to set, mapped to their new valuesRepositoryException
void setAttribute(java.lang.String name, java.lang.String value) throws RepositoryException
name
- the attribute namevalue
- the attribute value; if null, the attribute will be deleted.RepositoryException
void deleteAttributes(java.util.List<java.lang.String> names) throws RepositoryException
names
- the names of the attributes to deleteRepositoryException
void deleteAttribute(java.lang.String name) throws RepositoryException
name
- the name of the attribute to deleteRepositoryException
java.lang.String getType() throws RepositoryException
RepositoryException
void setType(java.lang.String type) throws RepositoryException
type
- the new MIME typeRepositoryException
java.io.InputStream read() throws RepositoryException
RepositoryException
java.io.InputStream read(long start, long len) throws RepositoryException
start
- the first byte of the data to sendlen
- the number of bytes to sendRepositoryException
long write(java.io.InputStream data) throws java.io.IOException, RepositoryException
data
- an InputStream streaming the new datajava.io.IOException
RepositoryException
long write(java.io.InputStream data, boolean append) throws java.io.IOException, RepositoryException
data
- an InputStream streaming the new dataappend
- whether to append the new data to the existing datajava.io.IOException
RepositoryException
long getSize() throws RepositoryException
RepositoryException