Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Extract .Z files

 
Ahmed Kotb
Ranch Hand
Posts: 35
Google Web Toolkit Hibernate Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,

Is there any Java Library that Support Extracting .Z Files ?
 
Ifteqar Ahmed
Ranch Hand
Posts: 85
Java Linux MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,


You can try with 7-Zip JBinding which uses the 7zip library internally. It's quite easy to use.

This can be downloaded from www.sourceforge.net
 
Ahmed Kotb
Ranch Hand
Posts: 35
Google Web Toolkit Hibernate Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ifteqar Ahmed wrote:
Hi,


You can try with 7-Zip JBinding which uses the 7zip library internally. It's quite easy to use.

This can be downloaded from www.sourceforge.net


do you mean that i will call 7-zip program and then path .Z file path to it or there is a library in java that can handle that?

Can you Explain More Please?
 
Rob Spoor
Sheriff
Pie
Posts: 20667
65
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This is the correct link.
 
Ahmed Kotb
Ranch Hand
Posts: 35
Google Web Toolkit Hibernate Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Rob Spoor wrote:
This is the correct link.


I can not use it How can I use it?
 
Tim Moores
Bartender
Posts: 2947
46
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ahmed Kotb wrote:How can I use it?

A link?
 
Leonardo Jose Gomes da Silva
Greenhorn
Posts: 7
Linux Oracle Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ahmed Kotb, you can use the a mix of File and ZipEntry...

Already I done something like to do a download .zip file...
But, what do you need to do exactly?

Hugs
 
Ahmed Kotb
Ranch Hand
Posts: 35
Google Web Toolkit Hibernate Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Leonardo Jose Gomes da Silva wrote:
Ahmed Kotb, you can use the a mix of File and ZipEntry...

Already I done something like to do a download .zip file...
But, what do you need to do exactly?


I want Library(JAR) that I can use it to Extract any .Z File or any Method that help me to Extract .Z files
 
Leonardo Jose Gomes da Silva
Greenhorn
Posts: 7
Linux Oracle Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ahmed Kotb wrote:
Leonardo Jose Gomes da Silva wrote:
Ahmed Kotb, you can use the a mix of File and ZipEntry...

Already I done something like to do a download .zip file...
But, what do you need to do exactly?


I want Library(JAR) that I can use it to Extract any .Z File or any Method that help me to Extract .Z files



Okay, look this example:




Hugs
 
Ahmed Kotb
Ranch Hand
Posts: 35
Google Web Toolkit Hibernate Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Leonardo Jose Gomes da Silva


It Doesn't work with .Z files , it Only works with .ZIP files.....I need to Extract .Z files not .ZIP
 
Tim Moores
Bartender
Posts: 2947
46
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
.Z files are not ZIP files, they're created using the compress tool. Java can't handle .Z out of the box, and neither can the Apache Commons Compress library.
 
Ahmed Kotb
Ranch Hand
Posts: 35
Google Web Toolkit Hibernate Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Tim Moores
.Z files are not ZIP files, they're created using the compress tool. Java can't handle .Z out of the box, and neither can the Apache Commons Compress library.


Sorry but you mean that there no way to Extract .Z files from Java???
 
Tim Moores
Bartender
Posts: 2947
46
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Of course it's possible. But -.Z not being a common file format any more- there is no widely used Java library for that (or maybe no library at all). In which case you would have to code it, or find a command you could call via the ProcessBuilder class. The UnxUtils contain such a tool for Windows, as does every Unix/Linux distribution in existence out of the box.
 
Rob Spoor
Sheriff
Pie
Posts: 20667
65
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I can clearly remember someone mentioning 7-Zip JBinding in this thread, and me linking to the SourceForge project That one uses 7-Zip through JNI.

Of course 7-Zip is open source so it shouldn't be too hard to write a pure Java library for it. It will probably just require quite a bit of work.
 
Ahmed Kotb
Ranch Hand
Posts: 35
Google Web Toolkit Hibernate Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks to All

I solved it by Executing gunzip Command on Linux and winrare on Windows with RunTime Object from Java. I know that this is not the Optimum Solution but it works for now.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic