I am trying to unzip some zip file, it has about 65 megs. Code snippets below:
This method actually unzips a file:
public synchronized void execute(Path
The unzip
command prints the details of the files it is unzipping to its standard output, so you need to read this in your Java program (via Process.getInputStream
). If you don't read the output in a timely fashion the process may block once its buffer gets full - this is spelled out in the javadoc of Process.
I recommend you call builder.redirectErrorStream(true)
and then ensure you read all the data from the process stream. You may also benefit from adding a -qq
argument to the unzip call, to minimise the amount of output it creates in the first place.