ZipHandling
Overview
This module includes 2 Java actions, ZipDocuments and UnzipDocument The ZipDocuments action allows you to ZIp a list of FileDocuments The UnzipDocument allows you to unzip a zipfile and direct result in a list of FileDocuments.
Documentation
Description
This module includes 2 Java actions, ZipDocuments and UnzipDocument
Typical usage scenario
When you want to interact with zipped files
Features and limitations
ZipDocuments : All Filedocuments from the list will be zipped in a new file, or in the given ZipFile.
UnzipDocument : Documents will be stored as a List of FileDocuments (Committed), delete the List at the end of microflow if you don't use all the files. UnzipDocuments can decompress these kind of archive formats: bzip2, gzip, pack200, lzma, xz, Snappy, traditional Unix Compress, DEFLATE, DEFLATE64, LZ4, Brotli, Zstandard and ar, cpio, jar, tar, zip, dump, 7z, arj.
Dependencies
- Mendix Modeler 7.7.1 or greater
- commons-compress-1.21.jar (included)
Installation [optional]
Import the module by using the default Import Module Package
Configuration
Use the Java Actions in a Microflow
For Unzip, give as imput parameter a FileDocument (that is the zipped file), as output you get a List of FileDocuments that include all the files in the zipfile
For ZIP, give as input parameter a list of FileDocuments, as output you get a output.zip zip file, including all files from the list. From verion 1.3.0 you can add a ZipFile parameter, it must be a generalization of FileDocument. The return zip will be stored in this ZipFile. If you let it empty , you need to use the return variable, which will be of type FileDocument.
Conversion to 4.6.x
Removed the input parameter ZipFile, that was used for specializated FileDocuments. Mendix does not allow to change input parameters anymore. Use the communityCommons DuplicateFileDocument to change the FileDocument to your own specialization. For this you have to reassign parameters for current use op ZipDocuments
Removed commons-compress jar. So it can be deleted from userlib folder if it is not used by other modules.
Conversion to 3.x
The ZipDocument has a new parameter, for conversion you can make this parameter empty, the result Zip is as it was in lower versions. If you want to use the generalization of FileDocument, create the object and add this to the parameter en unuse return variable.