decompress .gz file in batch
Posted
by kapildalwani
on Stack Overflow
See other posts from Stack Overflow
or by kapildalwani
Published on 2009-05-23T06:21:23Z
Indexed on
2010/04/24
1:33 UTC
Read the original article
Hit count: 362
I have 100 of .gz files which I need to de-compress. I have couple of questions
a) I am using the code given at http://www.roseindia.net/java/beginners/JavaUncompress.shtml to decompress the .gz file. Its working fine. Quest:- is there a way to get the file name of the zipped file. I know that Zip class of Java gives of enumeration of entery file to work upon. This can give me the filename, size etc stored in .zip file. But, do we have the same for .gz files or does the file name is same as filename.gz with .gz removed.
b) is there another elegant way to decompress .gz file by calling the utility function in the java code. Like calling 7-zip application from your java class. Then, I don't have to worry about input/output stream.
Thanks in advance. Kapil
© Stack Overflow or respective owner