net.sf.sevenzipjbinding
Interface IOutCreateCallback<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:
IProgress

public interface IOutCreateCallback<T extends IOutItemBase>
extends IProgress

The interface designed to provide necessary information about new or updated archive items and to receive information about the progress of the operation.

Since:
9.20-2.00
Author:
Boris Brodski

Method Summary
 T getItemInformation(int index, OutItemFactory<T> outItemFactory)
          Get information about archive item with index index being created or updated.
 ISequentialInStream getStream(int index)
          Return sequential in-stream for the archive item with index index to read and compress the content of the item.
 void setOperationResult(boolean operationResultOk)
          Notify about success or failure of the current archive item compression or update operation.
 
Methods inherited from interface net.sf.sevenzipjbinding.IProgress
setCompleted, setTotal
 

Method Detail

setOperationResult

void setOperationResult(boolean operationResultOk)
                        throws SevenZipException
Notify about success or failure of the current archive item compression or update operation.

Parameters:
operationResultOk - true current archive item was processed successfully, false otherwise.
Throws:
SevenZipException - in error case. If this method ends with an exception, the current operation will be reported to 7-Zip as failed. There are no guarantee, that there are no further call back methods will get called. The first and last thrown exceptions will be saved and thrown later on from the originally called method such as ISevenZipInArchive.extract() or SevenZip.openInArchive(). Up to four exceptions depending on the situation can be saved for further analysis. See SevenZipException and SevenZipException.printStackTraceExtended() for details.

getItemInformation

T getItemInformation(int index,
                     OutItemFactory<T> outItemFactory)
                                          throws SevenZipException
Get information about archive item with index index being created or updated. Consider following cases:

Parameters:
index - 0-based index of the item to get data. Same index returned by IOutItemBase.getIndex() of the outItem object.
outItemFactory - a factory to create a pre-initialized instance of the data object. The created object should be filled with information about the archive item with index index
Returns:
data object created with the outItemFactory filled with all necessary information for the current operation
Throws:
SevenZipException - in error case. If this method ends with an exception, the current operation will be reported to 7-Zip as failed. There are no guarantee, that there are no further call back methods will get called. The first and last thrown exceptions will be saved and thrown later on from the originally called method such as ISevenZipInArchive.extract() or SevenZip.openInArchive(). Up to four exceptions depending on the situation can be saved for further analysis. See SevenZipException and SevenZipException.printStackTraceExtended() for details.

getStream

ISequentialInStream getStream(int index)
                              throws SevenZipException
Return sequential in-stream for the archive item with index index to read and compress the content of the item. Depending on a archive format, this method may be called for any archive item including directories. null should be returned for archive items without any content.

Parameters:
index - index of the item to read content of (starting from 0)
Returns:
sequential in-stream pointed to the content of the archive item with index index. Return null for archive items without content (for example, for directories)
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.