Class ZipUtils

java.lang.Object
eu.europa.esig.dss.asic.common.ZipUtils

public final class ZipUtils extends Object
The class is used for processing (reading and creation) of ZIP archives See zipContainerHandler
  • Method Details

    • getInstance

      public static ZipUtils getInstance()
      Returns an instance of the ZipUtils class
      Returns:
      ZipUtils singleton
    • setZipContainerHandler

      public void setZipContainerHandler(ZipContainerHandler zipContainerHandler)
      Sets a handler to process ZIP-content retrieving Default : SecureContainerHandler
      Parameters:
      zipContainerHandler - ZipContainerHandler
    • extractContainerContent

      public List<DSSDocument> extractContainerContent(DSSDocument zipPackage)
      Extracts a list of DSSDocument from the given ZIP-archive
      Parameters:
      zipPackage - DSSDocument
      Returns:
      a list of DSSDocuments
    • extractEntryNames

      public List<String> extractEntryNames(DSSDocument zipPackage)
      Returns a list of ZIP archive entry names
      Parameters:
      zipPackage - DSSDocument
      Returns:
      a list of String entry names
    • createZipArchive

      public DSSDocument createZipArchive(List<DSSDocument> containerEntries, Date creationTime, String zipComment)
      Creates a ZIP-Archive with the given containerEntries
      Parameters:
      containerEntries - a list of DSSDocuments to embed into the new container instance
      creationTime - (Optional) Date defined time of an archive creation, will be set for all embedded files. If null, the local current time will be used
      zipComment - (Optional) String defined a zipComment
      Returns:
      DSSDocument ZIP-Archive
    • createZipArchive

      public DSSDocument createZipArchive(ASiCContent asicContent, Date creationTime)
      Creates a ZIP-Archive with the given asicContent
      Parameters:
      asicContent - ASiCContent to create a new ZIP Archive from
      creationTime - (Optional) Date defined time of an archive creation, will be set for all embedded files. If null, the local current time will be used
      Returns:
      DSSDocument ZIP-Archive