Skip to content

Tag: zip

Zip directory to multiple destinations using Gradle

Is it possible with Gradle’s Zip task to copy the resulting zip into multiple destinations? AFAIK you can only zip multiple input directories with only one output destination. Is there a way to zip a directory and copy the archive to multiple destinations (in one single task)? Since I’m bound to u…

Unzip specific zip file from nested zip file using ANT

I have a zip file ex. ‘test.zip’ that contains 2 more zip files within it – A.zip and B.zip. I want to only extract contents of A.zip and leave B.zip untouched. I did try out the below code snippet, but found no luck yet – Please advise how this could be achieved. Answer From the unzip…

how to decode Java stream in PHP

I requested Walmart report API and the result would be returned zip file stream.Refer to the API documents,it gives an example to realize it with Java code as the following below: However,if I use php like: It would download zip file but the file data is corrupt.It maybe such a reason like the byte stream is …

how to zip a folder itself using java

Suppose I have the following directory structure. Inside january there are suppose two excel files say A.xls and B.xls. There are many places where it has been written about how to zip files using java.util.zip. But I want to zip the january folder itself inside reports folder so that both january and january…

java Extracting Zip file

I’m looking for a way to extract Zip file. So far I have tried java.util.zip and org.apache.commons.compress, but both gave a corrupted output. Basically, the input is a ZIP file contain one single .doc file. java.util.zip: Output corrupted. org.apache.commons.compress: Output blank file, but with 2 mb …

Read Content from Files which are inside Zip file

I am trying to create a simple java program which reads and extracts the content from the file(s) inside zip file. Zip file contains 3 files (txt, pdf, docx). I need to read the contents of all these files and I am using Apache Tika for this purpose. Can somebody help me out here to achieve the functionality.…