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
I think problem is because of timeout constraint.
You can try below code to execute process
Runtime runtime = Runtime.getRuntime();
Process process = runtime.exec(commandLine);
I think it will work.
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.