X4 Produktdokumentation

Operation: Zip

With the Zip operation of the ZIP Converter, you compress the provided input in a ZIP file. You can define encryption and compression settings.

Parameters

sourcePath

Directory path to the file to be compressed/decompressed.

Note:

If you do not set this parameter, the file is provided via the adapter input. In this case, you must define a value for the inputName parameter.

Possible values:

Directory path

targetPath

Directory path to the location where the output is to be stored ("Target directory").

Note:

If this parameter is not set, the file is supplied via the adapter output.

Possible values:

Directory path

overwrite

Specifies whether to overwrite existing files with the same name.

Possible values:

  • true: Files will be overwritten.

Notes if the checkbox is selected (true):

  • If mergeContent is enabled, an error message is output because the file cannot be processed further.

  • If mergeContent is disbaled, the existing file is overwritten.

  • false: Files are not overwritten.

Notes if the checkbox is deselected (false):

  • If mergeContent is enabled, the files are merged.

  • If mergeContent is disabled, an error message is output because the file cannot be processed further.

mergeContent

Specifies whether to merge existing files with the same name.

Possible values:

  • true: Files are merged.

Notes if the checkbox is selected (true):

  • If overwrite is enabled, an error message is issued in the output because the file cannot be processed further.

  • If overwrite is disabled, the files are merged.

  • false: Files will not be merged.

Notes if the checkbox is deselected (false):

  • If overwrite is enabled, the existing file is overwritten.

  • If overwrite is disabled, an error message is output because the file cannot be processed further.

inputName

Name of the input file. Used when the sourcePath is not set.

Possible values:

File name of the file to be received as input or issued as output.

includeRootFolder

Specifies whether the root directory of the path to be zipped should be included in the ZIP file.

Note:

This parameter only works when zipping a folder. If you zip a single file and set the parameter, the parameter has no effect.

Possible values:

  • true: The root directory of the path to be zipped is contained in the ZIP file.
    Example: If you specify the path C:/users/myuser/downloads/ZipMe, the ZipMe folder is zipped, including all child objects.

  • false: The root directory of the path to be zipped is not included in the ZIP file.
    Example: If you specify the path C:/users/myuser/downloads/ZipMe, only the child objects of the ZipMe folder are zipped.

encryptedFiles

Specifies whether encrypted data are to be processed in the operation. With the Zip operation, the output ZIP file is password protected.

Possible values:

  • true

  • false

password

Password for encrypted files.

Possible values:

Any string

encryptionMethod

Specifies which encryption method is used when zipping if encryptedFiles is enabled.

Possible values:

  • No encryption: Do not use encryption when zipping

  • AES: Use AES encryption algorithm (key length: 256 bits)

  • Standard: Use the default encryption algorithm

compressionMethod

Specifies which compression algorithm is used when zipping.

Possible values:

  • Deflate (default): Lossless compression using a combination of the LZ77 algorithm and Huffman encoding.

Notes on the Deflate value:

  • Store: Data is not compressed, but packed into a single file.

Note on the STORE value:

This value is useful when sending/receiving multiple data/folders and the file size can be neglected. No time is required for packaging.

compressionLevel

Specifies the compression algorithm when zipping if the Deflate value is selected as the compressionMethod.

Possible values:

  • Fastest: Lowest compression level, but very fast compression

  • Fast: Low compression level, but fast compression

  • Normal (default) Optimal ratio between compression level and speed

  • Maximum: High compression level, but slower compression

  • Ultra: Highest compression level, but very slow compression

Status values

1

The adapter operation was executed successfully

-1

The operation failed due to a technical error.

Input

Depending on the configuration of the sourcePath parameter, the adapter expects different input.

  • If the sourcePath parameter is not set, the input of the adapter is zipped.

  • If the sourcePath parameter is set, the file(s) in the sourcePath are zipped and the adapter does not expect any specific input.

Output

Depending on the configuration of the targetPath parameter, the adapter returns different output.

  • If the targetPath parameter is not set, a ZIP file is output.

  • If the targetPath parameter is set, the result of the operation is stored in the location specified as the directory path.