The cabinet format is an efficient way to package multiple files. The cabinet format has two key features: multiple files can be stored in a single cabinet (.cab) file, and data compression is performed across file boundaries, which significantly improves the compression ratio. Cabinet file construction can be designed based on the number of files to be compressed and the expected patterns for gaining access to them (sequential, random, all at once, or a few at a time).
A key concept of the cabinet file is the folder. A folder is a collection of one or more files that are compressed as a single entity. Compressing files in folders instead of individually improves the compression ratio. Random access time suffers, however, because decoding (decompressing) any file in a folder requires that all preceding files in that folder must also be decoded. Because the cabinet format is designed to deliver file content, rather than to stream media, the focus is on maximum compression as opposed to quick decompression.
There are two reasons to use the cabinet technology with Java classes:
Cabinet files can be used to build Java applets with many classes and graphics or audio files that you would like compressed and that would not be shared by other sites. HTML pages use the <APPLET> tag to access the contents of applet cabinet files.
Cabinet files can be used to distribute Java class libraries to users so that your classes can be accessed like system classes by Java applets or applications. HTML pages use the <OBJECT> tag to download and access libraries. Note that the library scheme only supports the download and access of class files, not image or audio files. These files should be provided by the applet, not the cabinet file.
The Microsoft SDK for Java provides the cabarc utility that creates, extracts, and lists the contents of cabinet files. Cabarc uses a command-line interface similar to that of popular archiving tools, and supports wildcards and recursive directory searches. For details on this utility's command-line options, see the cabarc section of the Tools Reference.
Note The dubuild utility is an alternative to cabarc when distributing software using Microsoft® Internet Explorer 4.0. The dubuild utility creates distribution units (DUs) that are installed using the Java Package Manager (JPM). For more information, see Creating and Using Distribution Units (dubuild) and Java Package Manager.