CompressContent

Description:

Compresses or decompresses the contents of FlowFiles using a user-specified compression algorithm and updates the mime.type attribute as appropriate

Tags:

content, compress, decompress, gzip, bzip2, lzma, xz-lzma2, snappy, snappy framed

Properties:

In the list below, the names of required properties appear in bold. Any other properties (not in bold) are considered optional. The table also indicates any default values.

NameDefault ValueAllowable ValuesDescription
Modecompress
  • compress
  • decompress
Indicates whether the processor should compress content or decompress content. Must be either 'compress' or 'decompress'
Compression Formatuse mime.type attribute
  • use mime.type attribute
  • gzip
  • bzip2
  • xz-lzma2
  • lzma
  • snappy
  • snappy framed
The compression format to use. Valid values are: GZIP, BZIP2, XZ-LZMA2, LZMA, Snappy, and Snappy Framed
Compression Level1
  • 0
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
The compression level to use; this is valid only when using GZIP compression. A lower value results in faster processing but less compression; a value of 0 indicates no compression but simply archiving
Update Filenamefalse
  • true
  • false
If true, will remove the filename extension when decompressing data (only if the extension indicates the appropriate compression format) and add the appropriate extension when compressing data

Relationships:

NameDescription
successFlowFiles will be transferred to the success relationship after successfully being compressed or decompressed
failureFlowFiles will be transferred to the failure relationship if they fail to compress/decompress

Reads Attributes:

NameDescription
mime.typeIf the Compression Format is set to use mime.type attribute, this attribute is used to determine the compression type. Otherwise, this attribute is ignored.

Writes Attributes:

NameDescription
mime.typeIf the Mode property is set to compress, the appropriate MIME Type is set. If the Mode property is set to decompress and the file is successfully decompressed, this attribute is removed, as the MIME Type is no longer known.

State management:

This component does not store state.

Restricted:

This component is not restricted.

Input requirement:

This component requires an incoming relationship.