Here you can find the source of gunzipFile(File baseDir, File gzFile)
public static void gunzipFile(File baseDir, File gzFile) throws IOException
//package com.java2s; //License from project: Apache License import java.io.BufferedReader; import java.io.File; import java.io.IOException; import java.io.InputStreamReader; public class Main { public static void gunzipFile(File baseDir, File gzFile) throws IOException { System.out.println("gunzip'ing File: " + gzFile.toString()); Process p = Runtime.getRuntime().exec(String.format("gunzip %s", gzFile.getAbsolutePath())); BufferedReader stdError = new BufferedReader(new InputStreamReader(p.getErrorStream())); System.out.println("Here is the standard error of the command (if any):\n"); String s;//from w ww . j a va 2 s . co m while ((s = stdError.readLine()) != null) { System.out.println(s); } stdError.close(); } }