ZipDirectoryPostExecuter
Group |
|
Class Name |
com.ebd.hub.datawizard.postexec.ZipDirectoryPostExecuter |
Function |
This postexecuter is able to zip files from a directory and delivers the archive back to the Response Route. |
Description
File or Directory
This postexecuter can be used to zip files in a directory and return the created archive file to the Response Route (the Response Route then contains only the zipped files and no data from the mapping).
The ZipDirectoryPostExecuter takes all files from the specified directory or from the directory of a specified file and puts them into a ZIP file.
See examples below.
Ignored Files
Files ending with *.tmp or starting with ~ or . and files that have the name Thumbs.db are ignored. Since target files in Lobster_data are always created with the name ~...-tmp first, these files are also ignored. Note: There is one exception. If checkbox Append is set in the Response Route, the parameter of the postexecuter defines a folder that contains no files (e.g. ./tmp/CreateZip) and to path of the file of the Response Route points to this folder (e.g. ./tmp/CreateZip/Demo.txt), the postexecuter creates the file ./tmp/CreateZip/Demo.zip. , which contains a file Demo.txt with content from the mapping.
Deleted Files
If a directory has been specified, the directory with all contained files will be deleted.
If a specific file has been specified, the directory remains, but all files (except the one specified in the parameter) are deleted.
Description of Parameters
The only parameter (field Config file) to be specified is the path of the folder in which the files to be zipped are or the path of a specific file in the folder to be zipped (see example below). Variables can be used here as usual (with @VARNAME@).
Examples
If the path ./temp/myContainer is specified in field Config file, all files in this directory are zipped and returned to the Response Route. The myContainer directory and all included files are deleted. The name of the generated zip file is the name specified as the file name in the Response Route.
If the path ./temp/myContainer/myfile.txt is specified in field Config file, all files in this directory are zipped and returned to the Response Route. The myContainer directory is retained and all contained files (except myfile.txt) are deleted. The name of the generated zip file is the name specified as the file name in the Response Route.