aspose file tools*
The moose likes Java in General and the fly likes Extract .Z files Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Java in General
Bookmark "Extract .Z files" Watch "Extract .Z files" New topic
Author

Extract .Z files

Ahmed Kotb
Ranch Hand

Joined: Apr 29, 2011
Posts: 35

Hi All,

Is there any Java Library that Support Extracting .Z Files ?

Ahmed Kotb
Software Developer
Ifteqar Ahmed
Ranch Hand

Joined: May 02, 2011
Posts: 85

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

Joined: Apr 29, 2011
Posts: 35

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

Joined: Oct 27, 2005
Posts: 19543
    
  16

This is the correct link.


SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6
How To Ask Questions How To Answer Questions
Ahmed Kotb
Ranch Hand

Joined: Apr 29, 2011
Posts: 35


Rob Spoor wrote:
This is the correct link.


I can not use it How can I use it?
Tim Moores
Rancher

Joined: Sep 21, 2011
Posts: 2408
Ahmed Kotb wrote:How can I use it?

A link?
Leonardo Jose Gomes da Silva
Greenhorn

Joined: Dec 26, 2011
Posts: 7

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


Don't matter if your code are running, it need to be organized and well done!

Leonardo J. G. Silva
Analyst/Developer
Ahmed Kotb
Ranch Hand

Joined: Apr 29, 2011
Posts: 35

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

Joined: Dec 26, 2011
Posts: 7

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

Joined: Apr 29, 2011
Posts: 35

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
Rancher

Joined: Sep 21, 2011
Posts: 2408
.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

Joined: Apr 29, 2011
Posts: 35

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
Rancher

Joined: Sep 21, 2011
Posts: 2408
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

Joined: Oct 27, 2005
Posts: 19543
    
  16

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

Joined: Apr 29, 2011
Posts: 35

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.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Extract .Z files
 
Similar Threads
Finish my code please
how to read a .z file in c++?
①
WA #1.....word association
Price of exam in India