Solved

Decompress Java

Posted on 2011-02-21
7
742 Views
Last Modified: 2013-11-13
Hi

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

.arc,.arj,.cab,.lha,.zip,.compress,.gnuzip

I am aware that java.util.zip would help but not for all the above formats.
0
Comment
Question by:Rajan881
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
7 Comments
 
LVL 47

Accepted Solution

by:
for_yan earned 200 total points
ID: 34946287
This is about gzip (which is gnuzip, as I understand):
http://stackoverflow.com/questions/631484/decompress-a-gzip-archive-in-java
0
 
LVL 47

Assisted Solution

by:for_yan
for_yan earned 200 total points
ID: 34946397

There seems to be a lha decompressor beta on source forge

http://sourceforge.net/projects/lhadecompressor/files/lhadecompressor/0.9.0/

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
0
 
LVL 86

Assisted Solution

by:CEHJ
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
0
Increase Agility with Enabled Toolchains

Connect your existing build, deployment, management, monitoring, and collaboration platforms. From Puppet to Chef, HipChat to Slack, ServiceNow to JIRA, Splunk to New Relic and beyond, hand off data between systems to engage the right people.

Connect with xMatters.

 
LVL 92

Expert Comment

by:objects
ID: 34947181
0
 
LVL 92

Assisted Solution

by:objects
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
0
 

Author Comment

by:Rajan881
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)

arj.exe,expand.exe,extract.exe,gzip.exe,lha.exe,pak.exe,pkzipc.exe

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





0
 
LVL 92

Assisted Solution

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

Featured Post

The Ultimate Checklist to Optimize Your Website

Websites are getting bigger and complicated by the day. Video, images, custom fonts are all great for showcasing your product/service. But the price to pay in terms of reduced page load times and ultimately, decreased sales, can lead to some difficult decisions about what to cut.

Question has a verified solution.

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

Java functions are among the best things for programmers to work with as Java sites can be very easy to read and prepare. Java especially simplifies many processes in the coding industry as it helps integrate many forms of technology and different d…
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
This tutorial covers a practical example of lazy loading technique and early loading technique in a Singleton Design Pattern.
With the power of JIRA, there's an unlimited number of ways you can customize it, use it and benefit from it. With that in mind, there's bound to be things that I wasn't able to cover in this course. With this summary we'll look at some places to go…

691 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