Decompress Java

Posted on 2011-02-21
Last Modified: 2013-11-13

How to uncompress the below compressed formats in JAVA ? The utility would be running in a UNIX environment.


I am aware that would help but not for all the above formats.
Question by:Rajan881
LVL 47

Accepted Solution

for_yan earned 200 total points
ID: 34946287
This is about gzip (which is gnuzip, as I understand):
LVL 47

Assisted Solution

for_yan earned 200 total points
ID: 34946397

There seems to be a lha decompressor beta on source forge

It looks like ther is no much on other formats, I guess there is something also about .rar - you didn't mention it in your list

Maybe you'd be better off trying to use the system tools using Runtime.getRuntime() - I think
even in UNix envirronemnt  you can find tools without source code and not in Java
LVL 86

Assisted Solution

CEHJ earned 100 total points
ID: 34946645
There's no 'one size fits all' app that does this in Java. Not even in Unix probably, since it's against the grain of the Unix 'philosophy'. You'll need to install the app that performs the correct functionality for each archive and call it from Java
3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

LVL 92

Expert Comment

ID: 34947181
LVL 92

Assisted Solution

objects earned 200 total points
ID: 34947199
For any formats that you cannot locate a java library for you can use Runtime.exec() to call a command line utility to perform the decompression. Make sure you consume any generated from the process to avoid it locking up

Author Comment

ID: 34955930
Okay ..Thanks for all your comments on this. Now my query is

I am creating a java program and it uses the below utility to uncompress the file types (.arc,.arj,.cab,.lha,.zip,.compress,.gnuzip)


Does all the above utility is compatible with Unix also ? If not what are the substitute for these utility in Unix ?

LVL 92

Assisted Solution

objects earned 200 total points
ID: 34955982
they can be read on any platform assuming they have the right utilitys installed

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
groupSumClump challenge 9 98
custom annotations 9 30
web services creation SOAP vs REST 5 19
even odd program using while loop 3 27
Does the idea of dealing with bits scare or confuse you? Does it seem like a waste of time in an age where we all have terabytes of storage? If so, you're missing out on one of the core tools in every professional programmer's toolbox. Learn how to …
Introduction This article is the first of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article explains our test automation goals. Then rationale is given for the tools we use to a…
The viewer will learn how to implement Singleton Design Pattern in Java.
This video teaches viewers about errors in exception handling.

912 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now