Home » Questions » Computers [ Ask a new question ]

How to decompress the *.TGZ file without changing the orginal file? [duplicate]

How to decompress the *.TGZ file without changing the orginal file? [duplicate]

I decompress the file using following command:

Asked by: Guest | Views: 298
Total answers/comments: 1
bert [Entry]

"I agree with Jonathan Leffler, this is a java programmer asking how to access a compressed archive from his/her java program. The fact that it's a novice programmer, trying to do it the wrong way (through the OS), doesn't change that fact that this is a programming question that belongs on StackOverflow.

To answer the original question, doctorruss is correct in suggesting the use of a class. To access a .tar, .tar.gz or .tgz file, you should use a library capable of accessing tar archives. The package com.ice.tar implements a tar archive io package, and it is possible to combine this package with the java.util.zip package to handle .tar.gz files. You can either download directly, or find it in org.apache.tools.tar which is now part of ant.jar."