Can you unzip a file in one shot using Apache Commons Compress?
>From https://wiki.apache.org/commons/Compress, I see: final InputStream <https://wiki.apache.org/commons/InputStream> is = new FileInputStream <https://wiki.apache.org/commons/FileInputStream>(input); ArchiveInputStream <https://wiki.apache.org/commons/ArchiveInputStream> in = new ArchiveStreamFactory<https://wiki.apache.org/commons/ArchiveStreamFactory>().createArchiveInputStream("zip", is); ZipArchiveEntry <https://wiki.apache.org/commons/ZipArchiveEntry> entry = ( ZipArchiveEntry <https://wiki.apache.org/commons/ZipArchiveEntry>)in.getNextEntry(); OutputStream <https://wiki.apache.org/commons/OutputStream> out = new FileOutputStream <https://wiki.apache.org/commons/FileOutputStream>(new File(dir, entry.getName())); IOUtils.copy(in, out); out.close(); in.close(); But that looks like you (1) need to loop though the ZIP entries and (2) create dirs yourself. What am I missing? How about adding a decompress(source, dest) API? Thank you, Gary -- E-Mail: [email protected] | [email protected] JUnit in Action, 2nd Ed: <http://goog_1249600977>http://bit.ly/ECvg0 Spring Batch in Action: <http://s.apache.org/HOq>http://bit.ly/bqpbCK Blog: http://garygregory.wordpress.com Home: http://garygregory.com/ Tweet! http://twitter.com/GaryGregory
