Package com.ms.util.cab Previous
Previous
Contents
Contents
Index
Index
Next
Next

Class CabCreator

Constructors , Methods

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

This is the cabinet creating class.

For more information, see also CabFileEntry, CabConstants, and CabProgressInterface.


Constructors


CabCreator

public CabCreator(CabProgressInterface new_progress_interface);

Initializes CabCreator.

ParameterDescription
new_cab_creator_interface An interface through which progress reports are made.


Methods


abort

public void abort() throws IOException;

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

Exceptions:

IOException An I/O error occurred.


addStream

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

Adds a stream to the cabinet.

ParameterDescription
input The input stream corresponding to the file to add.
cffile A cabinet file entry with at least the name and date entries filled out.

Exceptions:

CabException An error occurred (such as attempting to add a stream without first having started a folder).

IOException An I/O error occurred.


complete

public void complete() throws CabException, IOException;

Completes cabinet creation.

Exceptions:

CabException An error occurred (such as attempting to create an empty cabinet).

IOException An I/O error 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 may be used multiple times in sequence.

ParameterDescription
output_stream The output stream for the completed cabinet.

Exceptions:

IOException An I/O error occurred.


newFolder

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

Begins a new folder.

ParameterDescription
folder_info An initialized cabinet folder entry indicating the type of compression to use for this folder.

Exceptions:

CabException An error occurred (such as unknown compression type).

IOException An I/O error occurred.


setSetID

public void setSetID(int new_set_id);

Sets 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.

ParameterDescription
new_set_id The Set ID for this cabinet (in the range 0...65535).



Top© 1997 Microsoft Corporation. All rights reserved. Legal Notices.