[Webinar] Streamline your web hosting managementRegister Today

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 766
  • Last Modified:

Decompress Java

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
Rajan881
Asked:
Rajan881
5 Solutions
 
for_yanCommented:
This is about gzip (which is gnuzip, as I understand):
http://stackoverflow.com/questions/631484/decompress-a-gzip-archive-in-java
0
 
for_yanCommented:

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
 
CEHJCommented:
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
The new generation of project management tools

With monday.com’s project management tool, you can see what everyone on your team is working in a single glance. Its intuitive dashboards are customizable, so you can create systems that work for you.

 
objectsCommented:
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
 
Rajan881Author Commented:
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
 
objectsCommented:
they can be read on any platform assuming they have the right utilitys installed
0

Featured Post

Get your problem seen by more experts

Be seen. Boost your question’s priority for more expert views and faster solutions

Tackle projects and never again get stuck behind a technical roadblock.
Join Now