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
The column containing the paths to the files/folders that must be compressed.
File
Path where the created archive should be saved.
Create missing folders
If enabled, missing folders in the specified path will be created automatically.
If exists
Specify the behavior of the node in case the output file already exists.
  • Fail: Will issue an error during the node's execution (to prevent unintentional overwrite).
  • Overwrite: Will replace any existing file.
Archive entry path
This mode determines what the folder structure looks like when you de-compress the archive.
  • Include only the selected file/folder: When de-compressing, only the selected source file/folder and its content will be created.
  • Include all folders in the source path: When de-compressing, the selected source file/folder, its content, and all parent folders will be created. 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: Behaves like Include all folders in the source path, except that the specified folder prefix (the beginning of the path) is stripped and those folders will not be created when de-compressing. Note: This mode might produce invalid archive entries that cannot be de-compressed; the node will fail in that case.
  • From table column: The archive entry name is taken from the selected table column. When de-compressing, the created folder structure will match the paths in that column. Note: This mode might produce invalid archive entry names; the node will fail in that case.
Folder prefix
The path prefix to strip from the beginning of each source path. Folders matching this prefix will not be created when de-compressing the archive.
Entry name column
The column containing the archive entry names. Both path columns and string columns are accepted. When de-compressing, the created folder structure will match the entries in this column.
Compression
The compression/archive format to use for the output file. Supported formats: zip, jar, tar, tar.gz, tar.bz2, cpio. If the compression format is changed, the file extension of the archive is adapted automatically.
  • zip: ZIP compression format
  • jar: JAR compression format
  • tar: TAR compression format (uncompressed)
  • tar.gz: TAR with GZIP compression
  • tar.bz2: TAR with BZIP2 compression
  • cpio: CPIO compression format
Include empty folders
If enabled, empty folders found within the source path will 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.