Interface DocumentMetaData
- All Superinterfaces:
Cloneable
,Serializable
- All Known Subinterfaces:
WriteableDocumentMetaData
- All Known Implementing Classes:
MemoryDocumentMetaData
,StaticDocumentMetaData
Provides access to the document's bundle meta-data information.
This class unifies the information from '/mimetype', '/META-INF/manifest.xml' and '/metadata.xml'. If the manifest
contains a mime-type declaration for an entry, that mime-type is reported by the repository methods.
The manifest file must follow the specification as outlined in the OpenDocument File format section 17.7. Encryption
is not yet supported but may be added later.
- Author:
- Thomas Morgner
-
Method Summary
Modifier and TypeMethodDescriptionclone()
getBundleAttribute
(String namespace, String attributeName) Returns a single document-meta-data attribute.Returns the bundle's defined mime-type.getEntryAttribute
(String entryName, String attributeName) String[]
getEntryAttributeNames
(String entryName) getEntryMimeType
(String entry) Returns the declared mime-type for the given entry.String[]
String[]
getMetaDataNames
(String namespace) String[]
-
Method Details
-
getBundleType
String getBundleType()Returns the bundle's defined mime-type. This value is read from the "/mimetype" entry (if existent) else from the manifest's "/" entry. The bundle type acts as a hint for the content processor on what content the main document contains. This entry is declarative - if the actual main document does not match the declared bundle type, parsing is allowed to fail.- Returns:
- the bundle type.
-
getEntryMimeType
Returns the declared mime-type for the given entry. The mime-type is declarative - if it does not match the actual content of the entry, the content processor may raise an error.- Parameters:
entry
- the entry path.- Returns:
- the mime-type.
-
getBundleAttribute
Returns a single document-meta-data attribute. Each attribute is specified by a namespace and attribute name and contains a single string value.- Parameters:
namespace
- the namespace uriattributeName
- the attribute name- Returns:
- the attribute value.
-
getManifestEntryNames
String[] getManifestEntryNames() -
getMetaDataNamespaces
String[] getMetaDataNamespaces() -
getMetaDataNames
-
getEntryAttribute
-
getEntryAttributeNames
-
clone
- Throws:
CloneNotSupportedException
-