• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How to tar and untar insing Java program

 
Ravi Prasad
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 9320
10
Linux Mac OS X Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Check this out
 
jason adam
Chicken Farmer ()
Ranch Hand
Posts: 1932
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 1932
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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?
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic