File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes I/O and Streams and the fly likes How to tar and untar insing Java program Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » I/O and Streams
Bookmark "How to tar and untar insing Java program" Watch "How to tar and untar insing Java program" New topic
Author

How to tar and untar insing Java program

Ravi Prasad
Greenhorn

Joined: Jul 13, 2001
Posts: 6
Hi,
I have a requirment, I want to write a java class which can do the tar and untar operation on a single file or on a folder (many files).
Can anyone through some light on this.
if some sample code is there please send it to me.
Thanks in advance
Regards
Ravi Prasad
------------------------------
Joe Ess
Bartender

Joined: Oct 29, 2001
Posts: 8867
    
    8

Check this out


"blabbing like a narcissistic fool with a superiority complex" ~ N.A.
[How To Ask Questions On JavaRanch]
jason adam
Chicken Farmer ()
Ranch Hand

Joined: May 08, 2001
Posts: 1932
Ravi,
Welcome to the Ranch!
We ain't got too many rules round these parts, but we do have our naming policy, which does not allow obviously fictitious names. Names with numbers in them of course violate this rule. Please head over here and change your name to fit our policy. Thanks!
Ravi Prasad
Greenhorn

Joined: Jul 13, 2001
Posts: 6
Hi,
Thank you adam. I have updated the name.
Thanks Joe Ess for your help. This web site is helpfull to me.

Thanks and Regards,
Ravi Prasad
---------------------------------
jason adam
Chicken Farmer ()
Ranch Hand

Joined: May 08, 2001
Posts: 1932
Originally posted by Ravi Prasad:
Hi,
Thank you adam. I have updated the name.


Actually, my first name is Jason, last name is Adam. It's a curse sometimes having two (actually 3, but I don't divulge my middlename ) first names.
And thank you for making the name change so quickly, we at the Ranch appreciate it!
Yit Ming Toh
Greenhorn

Joined: Jan 27, 2010
Posts: 5
i m also working on a piece of code that requires to perform gunzip and untar...

i am using
java.util.zip.GZIPInputStream for gunzip
and as for untar, i will be following the approach that is using apache's API (org.apache.tools.tar)
http://www.koders.com/java/fid5AE4054C955EF855A0717C954D6B41E9BA9C0AC8.aspx
Joseph Camaioni
Greenhorn

Joined: Apr 06, 2011
Posts: 1
Thanks for the timely update to this thread. But on the Gzip input stream, I do not see gunzip function on the page. Does the Inflator object just automatically recognize the file? By internal read of the file regardless of extension, or by the user assigned extension in the name, I am wondering?
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How to tar and untar insing Java program