Use JNI to call unrar

Source: Internet
Author: User

Official RAR website
There are examples of calling unrar. dll decompression in various languages, but there is no example of using Java JNI.
The author uses JNI to write a class unrar, which provides the two most common functions to decompress and list file information.


It was updated on July 15, July 28 because an exception was reported when the rarfile in the experiment was used by junrar, but WinRAR can be opened. I checked this file.
It is possible to decompress the package with WinRAR and then decompress the package with junrar, which indicates that the original file compression is not standard. The exception reported by unrar is:
"File is not valid RAR Archive" I can't do anything else, just reflect this exception to the Java exception information.

Some people have too many requirements and are too lazy to write them again.
Jniunrar download link

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.