Java Gunzip File gunzipFile(File baseDir, File gzFile)

Here you can find the source of gunzipFile(File baseDir, File gzFile)

Description

gunzip File

License

Apache License

Declaration

public static void gunzipFile(File baseDir, File gzFile) throws IOException 

Method Source Code


//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();

    }
}

Related

  1. gunzip(File gzippedFile, File destinationFile)
  2. gUnzip(File srcFile, File destFile)
  3. gunzip(InputStream packedData, OutputStream unpackedData)
  4. gunzip(String compressedStr)
  5. gunzip(String inFile, String outFile)
  6. gunzipFile(File file_input, File dir_output)
  7. gunzipFile(File inputGZippedFile, File outputFile)
  8. ungzip(byte[] bytes)