Discussion

1
Replies
1170
Views
SURESH BHYRAVAVARJHULA (BH.SURESH)
NESS

NESS
IN
BH.SURESH Member since 2014 15 posts
NESS
Posted: February 6, 2017
Last activity: February 8, 2017
Posted: 6 Feb 2017 7:05 EST
Last activity: 8 Feb 2017 9:01 EST
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, This thread is closed to future replies. Content and links will no longer be updated. If you have the same/similar Discussion, please write a new Discussion.