Package eu.europa.esig.dss.asic.common
Class ZipUtils
java.lang.Object
eu.europa.esig.dss.asic.common.ZipUtils
The class is used for processing (reading and creation) of ZIP archives
See
eu.europa.esig.dss.asic.common.ZipContainerHandler
-
Method Summary
Modifier and TypeMethodDescriptioncreateZipArchive
(ASiCContent asicContent) Creates a ZIP-Archive with the givenasicContent
, indicating teh current creation timecreateZipArchive
(ASiCContent asicContent, Date creationTime) Creates a ZIP-Archive with the givenasicContent
createZipArchive
(List<DSSDocument> containerEntries, Date creationTime, String zipComment) Creates a ZIP-Archive with the givencontainerEntries
extractContainerContent
(DSSDocument zipPackage) Extracts a list ofDSSDocument
from the given ZIP-archiveextractEntryNames
(DSSDocument zipPackage) Returns a list of ZIP archive entry namesstatic ZipUtils
Returns an instance of the ZipUtils classvoid
setZipContainerHandlerBuilder
(ZipContainerHandlerBuilder<?> zipContainerHandlerBuilder) Sets a builder to create an instance of a handler to process ZIP-content retrieving.
-
Method Details
-
getInstance
-
setZipContainerHandlerBuilder
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
Extracts a list ofDSSDocument
from the given ZIP-archive- Parameters:
zipPackage
-DSSDocument
- Returns:
- a list of
DSSDocument
s
-
extractEntryNames
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 givencontainerEntries
- Parameters:
containerEntries
- a list ofDSSDocument
s to embed into the new container instancecreationTime
- (Optional)Date
defined time of an archive creation, will be set for all embedded files. If null, the local current time will be usedzipComment
- (Optional)String
defined a zipComment- Returns:
DSSDocument
ZIP-Archive
-
createZipArchive
Creates a ZIP-Archive with the givenasicContent
, indicating teh current creation time- Parameters:
asicContent
-ASiCContent
to create a new ZIP Archive from- Returns:
DSSDocument
ZIP-Archive
-
createZipArchive
Creates a ZIP-Archive with the givenasicContent
- Parameters:
asicContent
-ASiCContent
to create a new ZIP Archive fromcreationTime
- (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
-