Sample code for 30+ languages & platforms
Java

UnGzip .tgz to get a .tar

See more Tar Archive Examples

A .tgz is simply a TAR archive compressed using GZip. It is also commonly referred to as a .tar.gz. Chilkat GZip can be used to ungzip to get an uncompressed .tar.

Chilkat Java Downloads

Chilkat2 Java
import com.chilkatsoft.chilkat2.ChilkatException;
import com.chilkatsoft.chilkat2.Gzip;

public class ChilkatExample {

    public static void main(String[] args) {
        Gzip gzip = new Gzip();

        try {
            gzip.uncompressFile("qa_data/tar/test.tgz", "qa_output/test.tar");
            System.out.println("success.");
        } catch (ChilkatException e) {
            System.out.println(e.getLastErrorText());
        }
    }
}