Class ManifestDocument

  • All Implemented Interfaces:
    Document, java.io.Serializable

    public class ManifestDocument
    extends DocumentImpl

    JAXB class for the manifest XML document type.

    JAXB class for the manifest XML document type.
    The manifest document provides information about

    • how and when this meta data archive was created
    • which files are part of this meta data archive
    It is derived from DocumentImpl, this means: also implements the Document interface with rather detailed information about this meta data archives origin.

    To unserialize / unmarshall a XML file to a ManifestDocument object, you can use the following code fragment:

        String filename = "manifest.xml";
        // XMLUtils from PubServerSDK
        ManifestDocument manifest = XMLUtils.objectFromXML(new FileReader(new File(filename)), ManifestDocument.class);
        // ...
      
    To serialize / marshall a ManifestDocument to a XML String, you can use the following code fragment:
        ManifestDocument manifest;
        // XMLUtils from PubServerSDK. There is also a couple of variants for serializing 
        // objects to XML in the XMLUtils class. 
        String xml = XMLUtils.objectToXML(manifest, ManifestDocument.class);
      

    See Also:
    Serialized Form
    • Constructor Detail

      • ManifestDocument

        public ManifestDocument()
    • Method Detail

      • getGenerator

        public Generator getGenerator()

        Gets the generator of this meta data archive.

        Gets the generator of this meta data archive.
        The generator is a non normative information about the component / application, which created this meta data archive. For more information see Generator.

        Returns:
        generator of this meta data archive.
      • setGenerator

        public void setGenerator​(Generator generator)

        Sets the generator of this meta data archive.

        Sets the generator of this meta data archive.
        The generator is a non normative information about the component / application, which created this meta data archive. For more information see Generator.

        Parameters:
        generator - of this meta data archive.
      • getContent

        public java.util.List<File> getContent()

        Gets content of this meta data archive.

        Gets content of this meta data archive, i.e. the list of files contained in this archive.
        See File for further information.

        Returns:
        list of files contained in this meta data archive
      • setContent

        public void setContent​(java.util.List<File> content)

        Sets content of this meta data archive.

        Sets content of this meta data archive, i.e. the list of files contained in this archive.
        See File for further information.

        Parameters:
        content - the new content
      • addFile

        public void addFile​(File file)

        Adds a file to this meta data archive.

        Adds a file to this meta data archive.
        Virtually the same could be achieved with

                        manifest.getContent().add(file);
         
        The content list is checked for null and set to a new ArrayList if required. Note: this does not actually add a file to the archive, but only add the information, that such a file should be present to the manifest of this archive.

        Parameters:
        file - file to be added to this meta data archive
      • removeFile

        public void removeFile​(java.lang.String fileName)

        Removes a file from this meta data archive.

        Removes a file from this meta data archive. The file is looked up by the name provided as parameter, e.g. spreads.xml or previews/0.jpg (see File.getName() for further information).
        Note: this does not actually remove the file from the archive, but only remove the information, that such a file should be present from the manifest of this archive.
        No error is reported, if such a file does not exist.

        Parameters:
        fileName - name of the file to be removed.