简体   繁体   English

用Java创建一个Cabinet文件

[英]Create a Cabinet file in Java

有没有人知道一个库,可以用纯Java创建一个文件柜?

I wrote a java application to do this (pure java implementation). 我写了一个java应用程序来做这个(纯java实现)。 It does not support compression and so it basically just packages the files together and adds the cabinet header to the system. 它不支持压缩,因此它基本上只将文件打包在一起,并将机柜标题添加到系统中。 It isn't too complicated to do, took me about a day to bash it out. 做起来并不复杂,花了我一天的时间来抨击它。

Not too sure how complex it would be to implement compression but I assume it would not be all that trivial. 不太确定实现压缩有多复杂,但我认为不会那么微不足道。 There is a fair bit of information available on the net on the structure of the cabinet file format. 关于cabinet文件格式的结构,网上有相当多的信息。

EDIT: now available on github: https://github.com/grahamrb/CabinetMaker 编辑:现在可以在github上找到: https//github.com/grahamrb/CabinetMaker

To get started you can use Java's DeflaterOutputStream to do Deflate compression which is one of the supported cab compression schemes. 要开始使用,您可以使用Java的DeflaterOutputStream来执行Deflate压缩,这是受支持的cab压缩方案之一。

Oh whaddaya know... I found one: cablib (but it's not in development since 2006) 哦,whaddaya知道......我发现了一个: cablib (但自2006年以来它还没有开发)

As far as I know, you can only create .cab files using the CABARC utility from Microsoft. 据我所知,您只能使用Microsoft的CABARC实用程序创建.cab文件。 So there is no "pure java" implementation. 所以没有“纯java”实现。

You can call something like: 你可以打电话给:

CABARC n myArchive.cab *.*

using Runtime.getRuntime().exec() to create myArchive.cab. 使用Runtime.getRuntime()。exec()创建myArchive.cab。

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

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