public class FilesystemDigitalObject extends AbstractDigitalObject implements DigitalObject
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
ATTRIBUTES_FILE_NAME |
Constructor and Description |
---|
FilesystemDigitalObject(FilesystemRepository repo,
java.io.File dir,
java.lang.String handle) |
Modifier and Type | Method and Description |
---|---|
DataElement |
createDataElement(java.lang.String name)
Creates a new data element with the given name in this digital object.
|
void |
delete()
Deletes this digital object from the repository through which it is being accessed.
|
void |
deleteAttribute(java.lang.String name)
Deletes a particular attribute.
|
void |
deleteAttributes(java.util.List<java.lang.String> names)
Deletes multiple attributes.
|
void |
deleteDataElement(java.lang.String name)
Deletes any data element of the given name.
|
static java.lang.String |
escape(java.lang.CharSequence s) |
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 digital object.
|
DataElement |
getDataElement(java.lang.String name)
Returns the data element with the given name.
|
java.lang.String |
getHandle()
Returns the identifier for this digital object.
|
Repository |
getRepository()
Returns the repository through which this digital object is being accessed.
|
CloseableIterator<java.util.Map.Entry<java.lang.String,java.lang.String>> |
listAttributes()
Returns a CloseableIterator view of the attributes of the digital object.
|
CloseableIterator<java.lang.String> |
listDataElementNames()
Provides a CloseableIterator view of the names of the data elements in this digital object.
|
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> atts)
Sets the value of multiple attributes.
|
boolean |
verifyDataElement(java.lang.String name)
Verifies whether a data element with the given name exists within this digital object
|
static void |
writeEmptyAttributesFile(java.io.File f,
java.lang.String handle) |
equals, getDataElementNames, getDataElements, getOrCreateDataElement, hashCode, listDataElements
getClass, notify, notifyAll, toString, wait, wait, wait
getDataElementNames, getDataElements, getOrCreateDataElement, listDataElements
public static final java.lang.String ATTRIBUTES_FILE_NAME
public FilesystemDigitalObject(FilesystemRepository repo, java.io.File dir, java.lang.String handle) throws RepositoryException
RepositoryException
public Repository getRepository()
DigitalObject
getRepository
in interface DigitalObject
public java.lang.String getHandle()
DigitalObject
getHandle
in interface DigitalObject
public void delete()
DigitalObject
delete
in interface DigitalObject
delete
in class AbstractDigitalObject
public static void writeEmptyAttributesFile(java.io.File f, java.lang.String handle) throws java.io.IOException
java.io.IOException
public static java.lang.String escape(java.lang.CharSequence s)
public java.util.Map<java.lang.String,java.lang.String> getAttributes() throws RepositoryException
DigitalObject
getAttributes
in interface DigitalObject
getAttributes
in class AbstractDigitalObject
RepositoryException
public CloseableIterator<java.util.Map.Entry<java.lang.String,java.lang.String>> listAttributes() throws RepositoryException
DigitalObject
listAttributes
in interface DigitalObject
listAttributes
in class AbstractDigitalObject
RepositoryException
public java.lang.String getAttribute(java.lang.String name) throws RepositoryException
DigitalObject
getAttribute
in interface DigitalObject
getAttribute
in class AbstractDigitalObject
name
- the attribute nameRepositoryException
public void setAttributes(java.util.Map<java.lang.String,java.lang.String> atts) throws RepositoryException
DigitalObject
setAttributes
in interface DigitalObject
setAttributes
in class AbstractDigitalObject
atts
- the attributes to set, mapped to their new valuesRepositoryException
public void setAttribute(java.lang.String name, java.lang.String value) throws RepositoryException
DigitalObject
setAttribute
in interface DigitalObject
name
- the attribute namevalue
- the attribute value; if null, the attribute will be deleted.RepositoryException
public void deleteAttributes(java.util.List<java.lang.String> names) throws RepositoryException
DigitalObject
deleteAttributes
in interface DigitalObject
deleteAttributes
in class AbstractDigitalObject
names
- the names of the attributes to deleteRepositoryException
public void deleteAttribute(java.lang.String name) throws RepositoryException
DigitalObject
deleteAttribute
in interface DigitalObject
name
- the name of the attribute to deleteRepositoryException
public boolean verifyDataElement(java.lang.String name) throws RepositoryException
DigitalObject
verifyDataElement
in interface DigitalObject
verifyDataElement
in class AbstractDigitalObject
name
- an identifier for a data elementRepositoryException
public DataElement createDataElement(java.lang.String name) throws CreationException, RepositoryException
DigitalObject
createDataElement
in interface DigitalObject
name
- the identifier for the new data elementCreationException
- if a data element with the given name already existsRepositoryException
public DataElement getDataElement(java.lang.String name) throws RepositoryException
DigitalObject
getDataElement
in interface DigitalObject
name
- the identifier for the data elementRepositoryException
public void deleteDataElement(java.lang.String name) throws RepositoryException
DigitalObject
deleteDataElement
in interface DigitalObject
deleteDataElement
in class AbstractDigitalObject
name
- the identifier for the data elementRepositoryException
public CloseableIterator<java.lang.String> listDataElementNames() throws RepositoryException
DigitalObject
listDataElementNames
in interface DigitalObject
listDataElementNames
in class AbstractDigitalObject
RepositoryException