Compress

The Compress transformation step enables the compression of designated files as part of a route. To add a compression transformation step to a Route Package Template take the following steps:

  1. Designate file filtering.
  2. Determine whether or not to proceed with route execution on step failure.
  3. Select compression options.
  4. Determine post transformation actions.
Note Step 1 is mandatory. All other steps are optional.

The following topics provide configuration details for the Compress transformation step:

Related topics:

Input Files

The Input Files settings consist of the selection Process only result from preceding step and determining the Name Filter.

Process only result from preceding step

When Process only result from preceding step is enabled only files produced by the preceding step will be used as input for this step.

When Process only result from preceding step is disabled or this is the first step all current working files will be used as input for this step.

Note The Name Filter settings will also be applied on a given set of input files.

Name Filter

The Name Filter can either be set to process all files forwarded by the selection of Process only result from preceding step or process files based on a designated filename pattern forwarded by the selection of Process only result from preceding step. If Process all files is selected, all files forwarded by the selection of Process only result from preceding step are processed. If Process files based on a filename pattern is selected, only the files that match the file globbing or regular expression pattern are processed.

Filename patterns

Filename pattern matching supports glob and regexp syntax expressions.

When the designated pattern type is File Globbing then the String representation of the filename is matched using a limited pattern language that resembles regular expressions but with a simpler syntax. For example:

  • Matches files ending in .xml.

    *.xml

  • Matches file names starting with foo. that have a double character extension.

    foo.??

  • Matches file names ending in .1, .2, .3, .4, .5, .6, .7, .8, .9, .0.

    *.[0-9]

  • Matches file names having a single character extension different from 1, 2, 3, 4, 5, 6, 7, 8, 9, 0.

    *.[!0-9]

When the designated syntax is Regular Expression then the String representation of the filename is matched against a Perl5.003 regular expressions. Perl5 extended regular expressions are also supported. For example:

  • Matches files ending in .xml or .txt.

    .*\.(xml|txt)

  • Case insensitive match of data.xml file.

    (?i)data\.xml

Proceed with route execution on step failure

If Proceed with route execution on step failure is checked, the route execution continues even if the step execution fails.

Compression Options

The compression options consists of determining compression algorithm and level for designated files. The compression options also include determining whether or not the compressed files is password protected and whether or not the designated files are compressed into a single archive.

Note Password protection is only available for the ZIP compression algorithm.
Note Compressing all files into a single archive is not available for the GZIP compression algorithm.

Compression algorithm

The selectable compression algorithms are:

  • ZIP
  • JAR
  • TAR
  • GZIP

The compression of tar.gz archives require two separate Compress steps. The first one to archive files in a tar archive and the second one to compress the tar archive into a gzip archive.

Compression level

The selectable compression levels are:

  • Store
  • Fastest
  • Fast
  • Normal
  • Good
  • Better
  • Best

As compressed file size decreases (from store to best), the time to compress increases.

Password for protected file

Note Password protection is only available for the ZIP compression algorithm.

If Password for protected file is selected, enter the desired password.

Confirm the password

If Password for protected file is selected, confirm the desired password.

Compress all files into a single archive

Note Compressing all files into a single archive is not available for the GZIP compression algorithm.

If Compress all files into a single archive is selected, all designated files are compressed into a single archive. An EL expression should be used to define the single archive name.

Example:

  • Target file name, containing timestamp:

    archive-${timestamp}.zip

If Compress all files into a single archive is not selected, each input file is compressed in a separate archive which is named as the input file (including extension) and with an algorithm specific extension added: .zip, .jar, .tar, or .gz

Post transformation action

The output file names will be the same as the input file names and with an algorithm specific extension added unless Compress all files into a single archive is selected. To change the file names use a Rename transformation step. To configure a Rename transformation step, refer to Rename. If Compress all files into a single archive is selected then the output file name is designated by the EL expression.

Related Links