Compress Files/Folder

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

Type
The selection mode.
  • File: Select a single file.
  • Folder: Select a single folder.
  • Files in folders: Select a folder and apply filters to select files within it.
Source
The path to the file or folder to select.
Include subfolders
Whether to include subfolders when selecting multiple files within a folder.
Filter by file extension
Enable filtering files by their extension (e.g. 'xlsx;xlsm').
File extensions
Semicolon-separated list of file extensions to include (e.g. 'xlsx;xlsm;xls'). Case-insensitive unless 'Case sensitive (extensions)' is enabled.
Case sensitive (extensions)
Treat the entered extensions as case sensitive when matching.
Filter by file name
Enable filtering by file name pattern with wildcards or regular expression.
File name filter pattern
Pattern for file name filtering. With type 'Wildcard', use '*' and '?'. With type 'Regex', enter a Java regular expression.
File name filter type
Choose how to interpret the file name pattern: wildcard or regular expression.
Case sensitive (names)
Make file name filtering case sensitive.
Include hidden files
Include hidden files in the selection.
Include special files
Include special file types (workflows etc).
Filter by folder name
Enable filtering of folders by name pattern before descending into them.
Folder name pattern
Pattern for folder name filtering. Use '*' and '?' with filter type 'Wildcard'. With type 'Regex', enter a Java regular expression.
Folder name filter type
Choose how to interpret the folder name pattern: wildcard or regular expression.
Case sensitive (folders)
Make folder name filtering case sensitive.
Include hidden folders
Descend into folders that are hidden (if they otherwise pass filters).
Follow symlinks
Follow symbolic links while traversing folders (only relevant when selecting a folder).
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 (always disabled), Mountpoint (disabled if not connected), and file systems provided via input port (disabled if connector node hasn't been executed).
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
Depending on the selected mode the location of the files/folders to be copied to the destination folder will differ.
  • File/folder only: This mode ensures that when de-compressing the archive solely the selected source file/folder and its content will be created.
  • Full 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.
  • Path after prefix: This mode behaves similar to the 'Full 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.
Folder prefix
The folder prefix (the beginning of the path) to be ignored when using 'Path after prefix' mode.
Compression
Select the desired compression format.
  • 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
This option allows to specify whether or not empty folders should be included in the archive.

Input Ports

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.