Class ManifestGenerationExtension


  • public class ManifestGenerationExtension
    extends java.lang.Object
    Extension to ZFile that will generate a manifest. The extension will register automatically with the ZFile.

    Creating this extension will ensure a manifest for the zip exists. This extension will generate a manifest if one does not exist and will update an existing manifest, if one does exist. The extension will also provide access to the manifest so that others may update the manifest.

    Apart from standard manifest elements, this extension does not handle any particular manifest features such as signing or adding custom attributes. It simply generates a plain manifest and provides infrastructure so that other extensions can add data in the manifest.

    The manifest itself will only be written when the ZFileExtension.beforeUpdate() notification is received, meaning all manifest manipulation is done in-memory.

    • Constructor Summary

      Constructors 
      Constructor Description
      ManifestGenerationExtension​(java.lang.String builtBy, java.lang.String createdBy)
      Creates a new extension.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void register​(ZFile zFile)
      Registers the extension with the ZFile provided in the constructor.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • ManifestGenerationExtension

        public ManifestGenerationExtension​(java.lang.String builtBy,
                                           java.lang.String createdBy)
        Creates a new extension. This will not register the extension with the provided ZFile. Until register(ZFile) is invoked, this extension is not used.
        Parameters:
        builtBy - who built the manifest?
        createdBy - who created the manifest?
    • Method Detail

      • register

        public void register​(ZFile zFile)
                      throws java.io.IOException
        Registers the extension with the ZFile provided in the constructor.
        Parameters:
        zFile - the zip file to add the extension to
        Throws:
        java.io.IOException - failed to analyze the zip