Apache Commons Unzip Method?

I recently discovered https://commons.apache.org/proper/commons-compress/zip.html , the Apache Commons compression library.

However, there is no direct method to simply unzip a given file to a specific directory.

Is there a canonical / easy way to do this?

+4
source share
1 answer

I do not know the package that does this. You need to write a code. It's not hard. I have not used this package, but it is easy to do in the JDK. Take a look at the ZipInputStream in the JDK. Use FileInputStream to open the file. Create a ZipInputStream from FileInputStream and you can read the records using getNextEntry. It is quite simple, but requires code.

+1
source

Source: https://habr.com/ru/post/1588868/


All Articles