Skip to main content

UnpackContent

Description

Unpacks the content of FlowFiles that have been packaged with one of several different Packaging Formats, emitting one to many FlowFiles for each input FlowFile. Supported formats are TAR, ZIP, and FlowFile Stream packages.

Tags

Unpack, archive, flowfile-stream, flowfile-stream-v3, tar, un-merge, zip

Properties

In the list below required Properties are shown with an asterisk (*). Other properties are considered optional. The table also indicates any default values, and whether a property supports the NiFi Expression Language.

Display NameAPI NameDefault ValueAllowable ValuesDescription
Packaging Format *Packaging Formatuse mime.type attribute
  • use mime.type attribute
  • tar
  • zip
  • flowfile-stream-v3
  • flowfile-stream-v2
  • flowfile-tar-v1
The Packaging Format used to create the file
Filename Character SetFilename Character SetUTF-8If supplied this character set will be supplied to the Zip utility to attempt to decode filenames using the specific character set. If not specified the default platform character set will be used. This is useful if a Zip was created with a different character set than the platform default and the zip uses non standard values to specify.

This property is only considered if:
  • the property Packaging Format has a value of zip or use mime.type attribute
File Filter *File Filter.*Only files contained in the archive whose names match the given regular expression will be extracted (tar/zip only)
PasswordPasswordPassword used for decrypting Zip archives encrypted with ZipCrypto or AES. Configuring a password disables support for alternative Zip compression algorithms.
Allow Stored Entries With Data Descriptor *allow-stored-entries-wddfalse
  • true
  • false
Some zip archives contain stored entries with data descriptors which by spec should not happen. If this property is true they will be read anyway. If false and such an entry is discovered the zip will fail to process.

This property is only considered if:
  • the property Packaging Format has a value of zip

Dynamic Properties

This component does not support dynamic properties.

Relationships

NameDescription
failureThe original FlowFile is sent to this relationship when it cannot be unpacked for some reason
originalThe original FlowFile is sent to this relationship after it has been successfully unpacked
successUnpacked FlowFiles are sent to this relationship

Reads Attributes

NameDescription
mime.typeIf the <Packaging Format> property is set to use mime.type attribute, this attribute is used to determine the FlowFile's MIME Type. In this case, if the attribute is set to application/tar, the TAR Packaging Format will be used. If the attribute is set to application/zip, the ZIP Packaging Format will be used. If the attribute is set to application/flowfile-v3 or application/flowfile-v2 or application/flowfile-v1, the appropriate FlowFile Packaging Format will be used. If this attribute is missing, the FlowFile will be routed to 'failure'. Otherwise, if the attribute's value is not one of those mentioned above, the FlowFile will be routed to 'success' without being unpacked. Use the File Filter property only extract files matching a specific regular expression.

Writes Attributes

NameDescription
file.creationTimeThe date and time that the file was created. For encrypted zip files this attribute always holds the same value as file.lastModifiedTime. For tar and unencrypted zip files if available it will be returned otherwise this will be the same value asfile.lastModifiedTime.
file.encryptionMethodThe encryption method for entries in Zip archives
file.groupThe group owner of the unpacked file (tar only)
file.lastAccessTimeThe date and time the file was last accessed (tar and unencrypted zip files only)
file.lastMetadataChangeThe date and time the file's metadata changed (tar only).
file.lastModifiedTimeThe date and time that the unpacked file was last modified (tar and zip only).
file.ownerThe owner of the unpacked file (tar only)
file.permissionsThe read/write/execute permissions of the unpacked file (tar and unencrypted zip files only)
file.sizeThe uncompressed size of the unpacked file (tar and zip only)
fragment.countThe number of unpacked FlowFiles generated from the parent FlowFile
fragment.identifierAll unpacked FlowFiles produced from the same parent FlowFile will have the same randomly generated UUID added for this attribute
fragment.indexA one-up number that indicates the ordering of the unpacked FlowFiles that were created from a single parent FlowFile
mime.typeIf the FlowFile is successfully unpacked, its MIME Type is no longer known, so the mime.type attribute is set to application/octet-stream.
segment.original.filenameThe filename of the parent FlowFile. Extensions of .tar, .zip or .pkg are removed because the MergeContent processor automatically adds those extensions if it is used to rebuild the original FlowFile

State Management

This component does not store state.

Restricted

This component is not restricted.

Input Requirement

This component requires an incoming relationship.

Example Use Cases

Use Case 1

Unpack Zip containing filenames with special characters, created on Windows with filename charset 'Cp437' or 'IBM437'.

Configuration

Set "Packaging Format" value to "zip" or "use mime.type attribute".
Set "Filename Character Set" value to "Cp437" or "IBM437".

System Resource Considerations

This component does not specify system resource considerations.

See Also

MergeContent