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.
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.
- Mendix Modeler 7.7.1 or greater
- commons-compress-1.21.jar (included)
Import the module by using the default Import Module Package
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 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.