ZIP File

Learn more about the component and how to use it.

ZIP File allows the compression of files in zip format.

Parameters

Take a look at the configuration parameters of the component. Parameters supported by Double Braces expressions are marked with (DB).

ParameterDescriptionDefault valueData type

File Name (DB)

Name of the file or full file path (i.e., tmp/processed/file.txt) of the file to be compressed. This parameter is also available when you click on the Add button in the Files parameter (valid for the Multiple Compress operation only).

data.csv

String

ZIP Operation

Define the type of operation (Compress, Multiple Compress, or Decompress).

Compress

String

Output File Name (DB)

Name of the zip file to be generated.

data.zip

String

Custom Files Specification

Valid for the Multiple Compress operation only. If the option is activated, it’s possible to dynamically pass the files to be compressed in the Files parameter. Otherwise, the files can be individually informed via key-value.

False

Boolean

Files

Valid for the Multiple Compress operation only. This field exists to define the files to be compressed dynamically (if Custom Files Specification is activated) or individually (by clicking on the Add button).

N/A

Array of Objects (JSON) or Options of Files

Set Charset

Valid for the Decompress operation only. If the option is activated, you can set a specific charset for the operation.

False

Boolean

Charset

Available only if Set Charset is enabled. Select the desired charset in this field.

N/A

Boolean

Fail On Error

If the option is enabled, the execution of the pipeline with an error will be interrupted; otherwise, the pipeline execution proceeds, but the result will show a false value for the "success" property.

False

Boolean

Messages flow

Input

The component accepts any entry message, being able to use it through Double Braces.

Output

Without error

{
"fileName": "data.csv",
"success": true
}

With error

{
"success": false,
"message": "File data.csv already exists.",
"exception":
"com.digibee.pipelineengine.exception.PipelineEngineRuntimeException"
}

ZIP File in action

Request answer

{
"success": true,
"outputFileName": "data.zip"
}
  • outputFileName: name of the file written.

  • success: if “true”, the operation has been successfully executed; if “false”, the operation failed.

Request answer with error

{
"exception": "java.io.FileNotFoundException: /tmp/pipeline-engine/3b3755ad-4256-429a-8898-2f7eea80f7db/data1.csv (No such file or directory)",
"message": "Encountered an I/O error while executing ZipFileConnector",
"success": false
}
  • success: “false” when the operation fails.

  • message: message about the error.

  • exception: information about the occurred type of error.

Files manipulation in the pipeline

The pipeline has a temporary and local area for file manipulation, which is separated and validated only during the execution of the flow.

That way, you must understand the access to the files as if it's made in a system of virtual files. The name of the files may contain any valid characters and extensions, which can also have a relative directory. For example:

  • data.csv

  • processing/data.csv

Any access attempt to absolute directories will be blocked during the execution of the pipeline.

Last updated