Packages
 In this topic

*Constructors

*Methods

 

Packages   PreviousThis PackageNext
Package com.ms.util.cab   Previous This
Package
Next

 


Class CabCreator

public final class CabCreator
{
  // Constructors
  public CabCreator(CabProgressInterface new_progress_interface);

  // Methods
  public void abort() throws IOException;
  public void addStream(InputStream input,
        CabFileEntry cffile) throws CabException, IOException;
  public void complete() throws CabException, IOException;
  public void create(OutputStream output_stream) throws IOException;
  public void newFolder(CabFolderEntry folder_info)
        throws CabException, IOException;
  public void setSetID(int new_set_id);
}

This class creates cabinets. For more information about cabinets, see CabFileEntry, CabConstants, and CabProgressInterface.

Constructors

CabCreator

public CabCreator(CabProgressInterface new_progress_interface);

Initializes a CabCreator object.

ParameterDescription
new_progress_interface An interface, through which progress reports are made.

Methods

abort

public void abort() throws IOException;

Aborts cabinet creation and closes the output_cabinet stream opened by the create method. If this method is called, it must be called after the create method and before the complete method. After this method has been called, this CabCreator object can still be used to create cabinets.

Return Value:

No return value.

Exceptions:

IOException if an input/output error occurred.

addStream

public void addStream(InputStream input, CabFileEntry cffile)
        throws CabException, IOException;

Adds a stream to the cabinet.

Return Value:

No return value.

ParameterDescription
input The input stream associated with the file to be added.
cffile A cabinet file entry. The name and date entries must be filled out at a minimum.

Exceptions:

com.ms.util.cab.CabException if an error (such as attempting to add a stream before starting a folder) has occurred.

IOException if an I/O error occurred.

complete

public void complete() throws CabException, IOException;

Completes the cabinet creation process.

Return Value:

No return value.

Exceptions:

com.ms.util.cab.CabException if an error (such as attempting to create an empty cabinet) has occurred.

IOException if an I/O error has occurred.

create

public void create(OutputStream output_stream) throws IOException;

Begins the creation of a new cabinet. Only one cabinet can be created at a time using the same CabCreator object. However, the same CabCreator object can be used repeatedly.

Return Value:

No return value.

ParameterDescription
output_stream The output stream for the completed cabinet.

Exceptions:

IOException if an I/O error occurred.

newFolder

public void newFolder(CabFolderEntry folder_info) throws CabException,
        IOException;

Begins a new folder.

Return Value:

No return value.

ParameterDescription
folder_info An initialized cabinet folder entry that indicates the type of compression designated for this folder.

Exceptions:

com.ms.util.cab.CabException if an error occurred (such as unknown compression type).

IOException if an I/O error occurred.

setSetID

public void setSetID(int new_set_id);

Establishes the Set ID of the cabinet being created. This method must be called after the create method and before the complete method. If this method is not called, the default Set ID is zero.

Return Value:

No return value.

ParameterDescription
new_set_id The Set ID for the cabinet. Values range from 0 to 65535.

upnrm.gif © 1998 Microsoft Corporation. All rights reserved. Terms of use.