简体   繁体   English

有没有使用Junrar库读取版本5的RAR文件的解决方案?

[英]Is there a solution to read the RAR files of version 5 using Junrar library?

I'm writing part of Java application responsible for reading archive files of different formats and preparing a preview mode. 我正在编写Java应用程序的一部分,负责读取不同格式的存档文件并准备预览模式。

Junrar library appeared to be the most reliable to work with RAR format, but it doesn't support the latest version 5 of rar. Junrar库似乎是使用RAR格式最可靠的库,但它不支持rar的最新版本5。 Only earlier versions are supported. 仅支持早期版本。

Junrar dev team confirms this fact here: https://github.com/junrar/junrar/issues/23 Junrar开发团队在这里确认了这一事实: https : //github.com/junrar/junrar/issues/23

Winrar by default creates rar files of version 5, but checkbox 'RAR4' in properties helps to create a file of version 4 - which is perfect to work with. Winrar默认情况下会创建版本5的rar文件,但是属性中的复选框“ RAR4”有助于创建版本4的文件-完美使用。 But you have to click it every time you archive the file - that's not a good way (earlier versions of Winrar can't be downloaded from official website). 但是,每次存档文件时都必须单击它-这不是一个好方法(无法从官方网站下载早期版本的Winrar)。

In my case file is stored as a byte array. 在我的情况下,文件存储为字节数组。 I don't need to UNRAR file, i just read it - i need 'name' and 'size' of every file inside of it - thus i prepare preview data of archive content as a small HTML table. 我不需要UNRAR文件,我只需要阅读它-我需要里面的每个文件的“名称”和“大小”,因此我将存档内容的预览数据准备为一个小的HTML表。

Do you know any other good library to work with Rar format? 您知道其他任何可以使用Rar格式的优秀库吗? I can't find any. 我找不到。 Or maybe you can imagine some good workarounds? 也许您可以想象一些好的解决方法?

There is no available solution to unrar RAR5 archives except Winrar itself. 除了Winrar本身,没有其他可用的解决方案来解压缩RAR5压缩文件。 You may call it as external program if it is possible on your OS. 如果可以在OS上将其称为外部程序,则可以将其调用。 I am also treating archives of different formats and I am using junrar for extracting RAR, RAR5 archives remain untreated. 我也在处理不同格式的档案,并且我正在使用junrar提取RAR,RAR5档案仍未得到处理。 Junrar initially was developed by Edmund Wagner, and some time ago the support was renewed by Beothorn . Junrar最初是由Edmund Wagner开发的,不久前Beothorn再次提供了支持。 But, much to my regret, he is not planning to implement RAR5 support for some reason. 但是,令我非常遗憾的是,由于某种原因,他不打算实施RAR5支持。 I have also checked Raroscope , it does not support RAR 5 neither. 我还检查了Raroscope ,它也不支持RAR 5。

By the way, another archive, which is not supported by open source java library, is ARJ. 顺便说一下,开源Java库不支持的另一个存档是ARJ。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM