Discussion

1
Replies
1080
Views
BH.SURESH Member since 2014 15 posts
NESS
Posted: 3 years ago
Last activity: 3 years 8 months ago
Closed

How to Unzip a zip file using file listener.

Hi team, I have a requirement to unzip a file which has been picked up by file listener. I tried the zip file data to be stored at temp location and to unzip then in service file using "file at a time". I have used following code to write data at particular temp location . Where Test here in below code is parse segment data, find it in attachment. try{ byte[] out=new byte[1024*1024]; out=tools.getPrimaryPage().getString("Test").getBytes(); //byte[] out = Base64Util.decodeToByteArray(Base64Util.encode(tools.getPrimaryPage().getString("Test"))); oLog.error(tools.getPrimaryPage().getString("Test")); java.io.File file = new java.io.File(DelFile); java.io.DataOutputStream dos = new java.io.DataOutputStream(new java.io.FileOutputStream(file)); dos.write(out); dos.flush(); dos.close(); } catch (Exception ex) { // }. And it is only working for very small text files if present in zip. but not for other types the files are not getting opened in temp location zip. please suggest on this Thanks, Suresh

***Moderator Edit: Vidyaranjan | Updated Categories***

Data Integration
Moderation Team has archived post
Share this page LinkedIn