Class ManifestDocument

java.lang.Object
com.priint.pubserver.metadata.xml.base.DocumentImpl
com.priint.pubserver.metadata.ManifestDocument
All Implemented Interfaces:
Document, 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:
  • Constructor Details

    • ManifestDocument

      public ManifestDocument()
  • Method Details

    • 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 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(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(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.