Interface DocumentMetaData

  • All Superinterfaces:
    Cloneable, Serializable
    All Known Subinterfaces:
    WriteableDocumentMetaData
    All Known Implementing Classes:
    MemoryDocumentMetaData, StaticDocumentMetaData

    public interface DocumentMetaData
    extends Serializable, Cloneable
    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 Detail

      • 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

        String getEntryMimeType​(String entry)
        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

        Object getBundleAttribute​(String namespace,
                                  String attributeName)
        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 uri
        attributeName - the attribute name
        Returns:
        the attribute value.
      • getManifestEntryNames

        String[] getManifestEntryNames()
      • getMetaDataNamespaces

        String[] getMetaDataNamespaces()
      • getMetaDataNames

        String[] getMetaDataNames​(String namespace)
      • getEntryAttribute

        String getEntryAttribute​(String entryName,
                                 String attributeName)
      • getEntryAttributeNames

        String[] getEntryAttributeNames​(String entryName)