I tried to use UnpackContent to extract the files within a zip file named
ABC DEF (1).zip. (the filename has spaces in its name).

UnpackContent seemed to work, but it did not preserve file attributes from
the files in the zip. For example, the  lastModifiedTime   is not available
so downstream I am unable to do
this: 
${file.lastModifiedTime:toDate("yyyy-MM-dd'T'HH:mm:ssZ"):format("yyyyMMddHHmmss")}

I did some digging and found that on the UnpackContent page, it says:
file.lastModifiedTime  "The date and time that the unpacked file was last
modified (*tar only*)."

I need these file attributes for those files I extract from the zip. So as
an alternative I tried configuring an ExecuteStreamCommand processor like
this:
Command Arguments  -c;"unzip -p -q < -"
Command Path  /bin/bash
Argument Delimiter   ;

It throws these errors:

16:41:30 UTCERROR13023d28-6154-17fd-b4e8-7a30b35980ca
ExecuteStreamCommand[id=13023d28-6154-17fd-b4e8-7a30b35980ca] Failed to
write flow file to stdin due to Broken pipe: java.io.IOException: Broken
pipe 16:41:30 UTCERROR13023d28-6154-17fd-b4e8-7a30b35980ca
ExecuteStreamCommand[id=13023d28-6154-17fd-b4e8-7a30b35980ca] Transferring
flow file FlowFile[filename=ABC DEF (1).zip] to nonzero status. Executable
command /bin/bash ended in an error: /bin/bash: -: No such file or directory

It does not seem to be applying the unzip to the stdin of the ESC
processor. None of the files in the zip archive are output from ESC.

What needs to be changed in my ESC configuration?

Thank you in advance for any help.

Reply via email to