• Post Reply Bookmark Topic Watch Topic
  • New Topic

How to extract a .tar.gz file?  RSS feed

 
ram shyam
Ranch Hand
Posts: 77
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,

I tried using GZIPInputStream on the file of type .tar.gz and wrote the outputstream which returned a file of type VisualPax Archive instead of a .tar type. So, I am not able to use any Runtime code to run "tar xvf" on the generated output file and untar the folder.

Please let me know how to extract the folder of type .tar.gz which contains multiple text files.

Thanks in advance!!
 
G.T. Reddy
Ranch Hand
Posts: 45
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can use WINRAR
 
ram shyam
Ranch Hand
Posts: 77
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

How do I use WINRAR in JAVA code?
 
Ulf Dittmer
Rancher
Posts: 42970
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I've used the Commons Compress library for tar processing in the past. Note that there's no binary build available; you'll need to grab the source code from the repository.
 
Rob Spoor
Sheriff
Posts: 20903
81
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If you use a library like Commons Compress or Java Tar that mimicks the behaviour of ZipInputStream et all, it's quite easy:
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!