Question

3
Replies
722
Views
Close popover
Kathy Dellinger (KathyD79)
Booz Allen Hamilton
Pega System Architect
Booz Allen Hamilton
US
KathyD79 Member since 2019 11 posts
Booz Allen Hamilton
Posted: August 12, 2019
Last activity: September 10, 2019
Closed

Unzip a Zip File Attachment

I have a requirement to have the user attach a zip file to a case, unzip the file, and continue processing the unzipped files. I have created a Java function in Pega to unzip a file. It has 2 parameters, destDir (destination directory to store the unzip files, and zipFile. First I had zipFile as a String representing the path to the zip file, but I could not figure out how to get the file path from the attachment. We are using Alfresco for out CMIS document management. Then I tried passing the .pyAttachStream of the attachment file, which is a String. In my Java function, I then tried to create a Java File or FileOutputStream from this String. I keep getting an Exception of "File or Directory does not exist". I don't know if I am using a wrong directory path or if something else is wrong. I have attached my Java function, the Activity that calls it, and the error message.

I also have to read the unzipped files back in to another activity for further processing.

Another other approaches? I was hoping that .pyAttachStream would give me a java.io.FileInputStream or something that I could just pass to the Java function.

***Moderator Edit-Vidyaranjan: Updated Platform Capability***

Data Integration Java and Activities Case Management
Moderation Team has archived post,
Close popover This thread is closed to future replies. Content and links will no longer be updated. If you have the same/similar Question, please write a new Question.