net.sf.sevenzipjbinding
Interface IOutCreateArchive<T extends IOutItemBase>

Type Parameters:
T - the type of the corresponding archive item data class (out item), like IOutItem7z or IOutItemZip. Use IOutItemAllFormats interface to support all available archive formats.
All Superinterfaces:
java.io.Closeable, IOutArchiveBase
All Known Subinterfaces:
IOutArchive<T>, IOutCreateArchive7z, IOutCreateArchiveBZip2, IOutCreateArchiveGZip, IOutCreateArchiveTar, IOutCreateArchiveZip
All Known Implementing Classes:
OutArchive7zImpl, OutArchiveBZip2Impl, OutArchiveGZipImpl, OutArchiveImpl, OutArchiveTarImpl, OutArchiveZipImpl

public interface IOutCreateArchive<T extends IOutItemBase>
extends IOutArchiveBase, java.io.Closeable

The central interface to create new archives. To update an existing archive open it first and then use IInArchive.getConnectedOutArchive() to get an instance of the IOutUpdateArchive interface.

The are two ways of getting an implementation of this interface:

NOTE: Each instance should be closed using Closeable.close() method.

Since:
9.20-2.00
Author:
Boris Brodski

Method Summary
 void createArchive(ISequentialOutStream outStream, int numberOfItems, IOutCreateCallback<? extends T> outCreateCallback)
          Create new archive.
 ArchiveFormat getArchiveFormat()
          Return archive format used with this instance of IOutStream
 
Methods inherited from interface net.sf.sevenzipjbinding.IOutArchiveBase
getTracePrintStream, isTrace, setTrace, setTracePrintStream
 
Methods inherited from interface java.io.Closeable
close
 

Method Detail

createArchive

void createArchive(ISequentialOutStream outStream,
                   int numberOfItems,
                   IOutCreateCallback<? extends T> outCreateCallback)
                   throws SevenZipException
Create new archive. To update an existing archive open it first and then use IInArchive.getConnectedOutArchive() to get an instance of the IOutUpdateArchive interface.

The outCreateCallback is designed to provide necessary information about new archive items and to receive information about the progress of the operation.

Note: some archive formats (like Zip) require an implementation of the IOutStream interface (instead of the ISequentialOutStream) to be passed.

Parameters:
outStream - output stream to receive the new archive. An implementation of the IOutStream interface is required for some archive formats.
numberOfItems - number of items in the new archive
outCreateCallback - callback object to exchange information about the archive create operation.
Throws:
SevenZipException - 7-Zip or 7-Zip-JBinding error occur. Use SevenZipException.printStackTraceExtended() to get stack traces of this SevenZipException and of the all thrown 'cause by' exceptions.

getArchiveFormat

ArchiveFormat getArchiveFormat()
Return archive format used with this instance of IOutStream

Returns:
archive format used with this instance of IOutStream