Compress Files/Folder (Table)

This node compresses files or a folder to an archive. If the compression format is being changed the file extension of the archive to create is adapted automatically.

Supported archive formats are:

  • .zip
  • .jar
  • .tar
  • .tar.gz
  • .tar.bz2
  • .cpio

Note:This node cannot compress KNIME artifacts such as workflows. In order to compress workflows please use a combination of Workflow Reader and Workflow Writer instead.

This node can access a variety of different file systems. More information about file handling in KNIME can be found in the official File Handling Guide.

Options

Source column
Allows to select the column containing the paths to the files/folders that must be compressed.
Write to
Select a file system on which you want to save your archive file. There are four default file system options to choose from:
  • Local File System: Allows you to select a folder on your local system.
  • Mountpoint: Allows you to write to a mountpoint. When selected, a new drop-down menu appears to choose the mountpoint. Unconnected mountpoints are greyed out but can still be selected (note that browsing is disabled in this case). Go to the KNIME Explorer and connect to the mountpoint to enable browsing. A mountpoint is displayed in red if it was previously selected but is no longer available. You won't be able to save the dialog as long as you don't select a valid i.e. known mountpoint.
  • Relative to: Allows you to choose whether to resolve the path relative to the current mountpoint, current workflow or the current workflow's data area. When selected a new drop-down menu appears to choose which of the three options to use.
  • Custom/KNIME URL: Allows to specify a URL (e.g. file://, http:// or knime:// protocol). When selected, a spinner appears that allows you to specify the desired connection and write timeout in milliseconds. In case it takes longer to connect to the host / write the file, the node fails to execute. Browsing is disabled for this option.
It is possible to use other file systems with this node. Therefore, you have to enable the file system connection input port of this node by clicking the ... in the bottom left corner of the node's icon and choose Add ports followed by Destination file system connection .
Afterwards, you can simply connect the desired connector node to this node. The file system connection will then be shown in the drop-down menu. It is grayed out if the file system is not connected in which case you have to (re)execute the connector node first. Note: The default file systems listed above can't be selected if a file system is provided via the input port.
File
Enter a valid path where the created archive should get saved. The required syntax of a path depends on the chosen file system, such as "C:\path\to\file" (Local File System on Windows) or "/path/to/file" (Local File System on Linux/MacOS and Mountpoint). For file systems connected via input port, the node description of the respective connector node describes the required path format. You can also choose a previously selected folder from the drop-down list, or select a location from the "Browse..." dialog. Note that browsing is disabled in some cases:
  • Custom/KNIME URL: Browsing is always disabled.
  • Mountpoint: Browsing is disabled if the selected mountpoint isn't connected. Go to the KNIME Explorer and connect to the mountpoint to enable browsing.
  • File systems provided via input port: Browsing is disabled if the connector node hasn't been executed since the workflow has been opened. (Re)execute the connector node to enable browsing.
The location can be exposed as or automatically set via a path flow variable.
Create missing folders
Select if the folders of the selected output location should be created if they do not already exist. If this option is unchecked, the node will fail if a folder does not exist.
If exists
Specify the behavior of the node in case the output file already exists.
  • Overwrite: Will replace any existing file.
  • Ignore: Will ignore existing files
  • Fail: Will issue an error during the node's execution (to prevent unintentional overwrite).
Archive entry path
This mode determines what the folder structure looks like when you de-compress the archive.
  • Include only the selected file/folder: This mode ensures that when de-compressing the archive solely the selected source file/folder and its content will be created.
  • Include all folders in the source path: This mode ensures that when de-compressing the archive the selected source file/folder, its content as well as the folders containing the selected source will be created. Note that those additional folders don't contain any other files/folders other than those to be compressed.
  • Include all folders in the source path succeeding the prefix: This mode behaves similar to the include all folders in the source path option, except that the specified folder prefix (the beginning of the path) is being ignored, i.e., the folders in the prefix will not be created when de-compressing the archive. Note: This mode might create invalid archive entries, i.e., entries resulting in archives that would not be de-compressible. In this case the node will fail.
  • From table column: This mode ensures that the archive entry name matches the one specified by the selected column, in other words, when de-compressing the archive the created folder structure will coincide with the one specified by the selected column.
Note: The last two modes might create invalid archive entry names, i.e., entry names resulting in archives that would not be de-compressible. In these cases the node will fail.
Compression
Allows to select the desired compression format.
Include empty folders
This option allows to specify whether or not empty folders should be included in the archive.

Input Ports

Icon
The input table containing a Path column.
Icon
The source file system connection.
Icon
The destination file system connection.

Output Ports

This node has no output ports

Views

This node has no views

Workflows

Links

Developers

You want to see the source code for this node? Click the following button and we’ll use our super-powers to find it for you.