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 eu.europa.esig.dss.asic.common.ZipContainerHandler
  • Method Details

    • getInstance

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

      public void setZipContainerHandlerBuilder(ZipContainerHandlerBuilder<?> zipContainerHandlerBuilder)
      Sets a builder to create an instance of a handler to process ZIP-content retrieving. The handler will be created on each call of ZipUtils class. Default : SecureContainerHandlerBuilder
      Parameters:
      zipContainerHandlerBuilder - ZipContainerHandlerBuilder
    • 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)
      Creates a ZIP-Archive with the given asicContent, indicating teh current creation time
      Parameters:
      asicContent - ASiCContent to create a new ZIP Archive from
      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