• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Tim Cooke
  • Campbell Ritchie
  • paul wheaton
  • Ron McLeod
  • Devaka Cooray
Sheriffs:
  • Jeanne Boyarsky
  • Liutauras Vilda
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Carey Brown
  • Piet Souris
Bartenders:

Reading RAR file

 
Ranch Hand
Posts: 39
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
I am trying to find checksum of all class files in a archive (zip /rar)
I have a method which takes Input Stream as input and returns checksum for the class.
I am able to read the zip archive using ZipInputStream ,ZipEntry and ZipFile classes but somehow not able to read rar files.
I came across few 3rd party jars which claim to read Rar file(RaroScope.I guess that was the name).
Just wanted to know if I can do it in Java.
I am using below code .The second line returns null in case of rar file but it returns an entry in case of zip file


Kindly provide me with some suggestions.
 
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
RAR is not ZIP, so it's no wonder that this doesn't work. The standard Java compression library (Apache Commons Compress) doesn't handle it, either, so you'll have to use a 3rd party implementation like https://github.com/edmund-wagner/junrar
 
Ankur Luthra
Ranch Hand
Posts: 39
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Ulf Dittmer wrote:RAR is not ZIP, so it's no wonder that this doesn't work. The standard Java compression library (Apache Commons Compress) doesn't handle it, either, so you'll have to use a 3rd party implementation like https://github.com/edmund-wagner/junrar



Thanks Dittmer for your advice :-)
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic