Class UnpackContent
java.lang.Object
org.apache.nifi.components.AbstractConfigurableComponent
org.apache.nifi.processor.AbstractSessionFactoryProcessor
org.apache.nifi.processor.AbstractProcessor
org.apache.nifi.processors.standard.UnpackContent
- All Implemented Interfaces:
org.apache.nifi.components.ConfigurableComponent,org.apache.nifi.processor.Processor
@SideEffectFree
@SupportsBatching
@InputRequirement(INPUT_REQUIRED)
@Tags({"Unpack","un-merge","tar","zip","archive","flowfile-stream","flowfile-stream-v3"})
@CapabilityDescription("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.")
@ReadsAttribute(attribute="mime.type",
description="If 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.")
@WritesAttribute(attribute="mime.type",description="If the FlowFile is successfully unpacked, its MIME Type is no longer known, so the mime.type attribute is set to application/octet-stream.") @WritesAttribute(attribute="fragment.identifier",description="All unpacked FlowFiles produced from the same parent FlowFile will have the same randomly generated UUID added for this attribute") @WritesAttribute(attribute="fragment.index",description="A one-up number that indicates the ordering of the unpacked FlowFiles that were created from a single parent FlowFile") @WritesAttribute(attribute="fragment.count",description="The number of unpacked FlowFiles generated from the parent FlowFile") @WritesAttribute(attribute="segment.original.filename ",description="The 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") @WritesAttribute(attribute="file.lastModifiedTime",description="The date and time that the unpacked file was last modified (tar and zip only).") @WritesAttribute(attribute="file.creationTime",description="The 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.") @WritesAttribute(attribute="file.lastMetadataChange",description="The date and time the file\'s metadata changed (tar only).") @WritesAttribute(attribute="file.lastAccessTime",description="The date and time the file was last accessed (tar and unencrypted zip files only)") @WritesAttribute(attribute="file.owner",description="The owner of the unpacked file (tar only)") @WritesAttribute(attribute="file.group",description="The group owner of the unpacked file (tar only)") @WritesAttribute(attribute="file.size",description="The uncompressed size of the unpacked file (tar and zip only)") @WritesAttribute(attribute="file.permissions",description="The read/write/execute permissions of the unpacked file (tar and unencrypted zip files only)") @WritesAttribute(attribute="file.encryptionMethod",description="The encryption method for entries in Zip archives")
@SeeAlso(MergeContent.class)
@UseCase(description="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\".\nSet \"Filename Character Set\" value to \"Cp437\" or \"IBM437\".\n")
public class UnpackContent
extends org.apache.nifi.processor.AbstractProcessor
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprivate static classprotected static enumprivate static classprivate static classprivate static class -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final org.apache.nifi.components.PropertyDescriptorstatic final Stringstatic final DateTimeFormatterstatic final Stringstatic final Stringstatic final org.apache.nifi.components.PropertyDescriptorstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringprivate Patternstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final org.apache.nifi.components.PropertyDescriptorstatic final org.apache.nifi.components.PropertyDescriptorprivate static final List<org.apache.nifi.components.PropertyDescriptor> static final org.apache.nifi.processor.Relationshipstatic final org.apache.nifi.processor.Relationshipstatic final org.apache.nifi.processor.Relationshipprivate static final Set<org.apache.nifi.processor.Relationship> static final Stringstatic final Stringprivate UnpackContent.Unpackerstatic final org.apache.nifi.components.PropertyDescriptorstatic final Stringprivate UnpackContent.Unpacker -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate voidfinishFragmentAttributes(org.apache.nifi.processor.ProcessSession session, org.apache.nifi.flowfile.FlowFile source, List<org.apache.nifi.flowfile.FlowFile> unpacked) Set<org.apache.nifi.processor.Relationship> protected List<org.apache.nifi.components.PropertyDescriptor> voidonScheduled(org.apache.nifi.processor.ProcessContext context) voidvoidonTrigger(org.apache.nifi.processor.ProcessContext context, org.apache.nifi.processor.ProcessSession session) Methods inherited from class org.apache.nifi.processor.AbstractProcessor
onTriggerMethods inherited from class org.apache.nifi.processor.AbstractSessionFactoryProcessor
getControllerServiceLookup, getIdentifier, getLogger, getNodeTypeProvider, init, initialize, isConfigurationRestored, isScheduled, toString, updateConfiguredRestoredTrue, updateScheduledFalse, updateScheduledTrueMethods inherited from class org.apache.nifi.components.AbstractConfigurableComponent
customValidate, equals, getPropertyDescriptor, getPropertyDescriptors, getSupportedDynamicPropertyDescriptor, hashCode, onPropertyModified, validateMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface org.apache.nifi.components.ConfigurableComponent
getPropertyDescriptor, getPropertyDescriptors, onPropertyModified, validateMethods inherited from interface org.apache.nifi.processor.Processor
isStateful, migrateProperties, migrateRelationships
-
Field Details
-
FRAGMENT_ID
-
FRAGMENT_INDEX
-
FRAGMENT_COUNT
-
SEGMENT_ORIGINAL_FILENAME
-
AUTO_DETECT_FORMAT_NAME
- See Also:
-
TAR_FORMAT_NAME
- See Also:
-
ZIP_FORMAT_NAME
- See Also:
-
FLOWFILE_STREAM_FORMAT_V3_NAME
- See Also:
-
FLOWFILE_STREAM_FORMAT_V2_NAME
- See Also:
-
FLOWFILE_TAR_FORMAT_NAME
- See Also:
-
OCTET_STREAM
- See Also:
-
FILE_LAST_MODIFIED_TIME_ATTRIBUTE
- See Also:
-
FILE_CREATION_TIME_ATTRIBUTE
- See Also:
-
FILE_LAST_METADATA_CHANGE_ATTRIBUTE
- See Also:
-
FILE_LAST_ACCESS_TIME_ATTRIBUTE
- See Also:
-
FILE_OWNER_ATTRIBUTE
- See Also:
-
FILE_GROUP_ATTRIBUTE
- See Also:
-
FILE_SIZE_ATTRIBUTE
- See Also:
-
FILE_PERMISSIONS_ATTRIBUTE
- See Also:
-
FILE_ENCRYPTION_METHOD_ATTRIBUTE
- See Also:
-
FILE_MODIFIED_DATE_ATTR_FORMAT
- See Also:
-
DATE_TIME_FORMATTER
-
PACKAGING_FORMAT
public static final org.apache.nifi.components.PropertyDescriptor PACKAGING_FORMAT -
ZIP_FILENAME_CHARSET
public static final org.apache.nifi.components.PropertyDescriptor ZIP_FILENAME_CHARSET -
FILE_FILTER
public static final org.apache.nifi.components.PropertyDescriptor FILE_FILTER -
PASSWORD
public static final org.apache.nifi.components.PropertyDescriptor PASSWORD -
ALLOW_STORED_ENTRIES_WITH_DATA_DESCRIPTOR
public static final org.apache.nifi.components.PropertyDescriptor ALLOW_STORED_ENTRIES_WITH_DATA_DESCRIPTOR -
PROPERTY_DESCRIPTORS
-
REL_SUCCESS
public static final org.apache.nifi.processor.Relationship REL_SUCCESS -
REL_ORIGINAL
public static final org.apache.nifi.processor.Relationship REL_ORIGINAL -
REL_FAILURE
public static final org.apache.nifi.processor.Relationship REL_FAILURE -
RELATIONSHIPS
-
fileFilter
-
tarUnpacker
-
zipUnpacker
-
-
Constructor Details
-
UnpackContent
public UnpackContent()
-
-
Method Details
-
getRelationships
- Specified by:
getRelationshipsin interfaceorg.apache.nifi.processor.Processor- Overrides:
getRelationshipsin classorg.apache.nifi.processor.AbstractSessionFactoryProcessor
-
getSupportedPropertyDescriptors
- Overrides:
getSupportedPropertyDescriptorsin classorg.apache.nifi.components.AbstractConfigurableComponent
-
onStopped
@OnStopped public void onStopped() -
onScheduled
@OnScheduled public void onScheduled(org.apache.nifi.processor.ProcessContext context) throws org.apache.nifi.processor.exception.ProcessException - Throws:
org.apache.nifi.processor.exception.ProcessException
-
onTrigger
public void onTrigger(org.apache.nifi.processor.ProcessContext context, org.apache.nifi.processor.ProcessSession session) throws org.apache.nifi.processor.exception.ProcessException - Specified by:
onTriggerin classorg.apache.nifi.processor.AbstractProcessor- Throws:
org.apache.nifi.processor.exception.ProcessException
-
finishFragmentAttributes
private void finishFragmentAttributes(org.apache.nifi.processor.ProcessSession session, org.apache.nifi.flowfile.FlowFile source, List<org.apache.nifi.flowfile.FlowFile> unpacked)
-