Orism
Orism

Reputation:

Create a Cabinet file in Java

does anyone know a library that makes it possible to create a cabinet file in pure Java?

Upvotes: 3

Views: 2795

Answers (3)

grahamrb
grahamrb

Reputation: 2269

I wrote a java application to do this (pure java implementation). 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.

EDIT: now available on github: https://github.com/grahamrb/CabinetMaker

Upvotes: 3

Karl the Pagan
Karl the Pagan

Reputation: 1965

To get started you can use Java's DeflaterOutputStream to do Deflate compression which is one of the supported cab compression schemes.

Oh whaddaya know... I found one: cablib (but it's not in development since 2006)

Upvotes: 1

arturh
arturh

Reputation: 6106

As far as I know, you can only create .cab files using the CABARC utility from Microsoft. So there is no "pure java" implementation.

You can call something like:

CABARC n myArchive.cab *.*

using Runtime.getRuntime().exec() to create myArchive.cab.

Upvotes: 0

Related Questions