|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
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.public interface IOutCreateCallback<T extends IOutItemBase>
The interface designed to provide necessary information about new or updated archive items and to receive information about the progress of the operation.
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 |
---|
void setOperationResult(boolean operationResultOk) throws SevenZipException
operationResultOk
- true
current archive item was processed successfully, false
otherwise.
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.T getItemInformation(int index, OutItemFactory<T> outItemFactory) throws SevenZipException
index
being created or updated. Consider following
cases:
public IOutItemZip getItemInformation(int index, OutItemFactory<
IOutItemZip>
outItemFactory) throws SevenZipException { IOutItemZip outItem = outItemFactory.createOutItem(); outItem.setDataSize(size); outItem.setPropertyPath("readme.txt"); // Set all other required properties here return outItem; }
public IOutItemZip getItemInformation(int index, OutItemFactory<
IOutItemZip>
outItemFactory) throws SevenZipException { // Determine index of the corresponding existing item in the old archive (archive being updated) int oldIndex = ...; IOutItemZip outItem = outItemFactory.createOutItem(oldIndex); outItem.setPropertyPath("readme.txt"); // Set all other required properties here return outItem; }
public IOutItemZip getItemInformation(int index, OutItemFactory<
IOutItemZip>
outItemFactory) throws SevenZipException { // Determine index of the corresponding existing item in the old archive (archive being updated) int oldIndex = ...; IOutItemZip outItem = outItemFactory.createOutItemAndCloneProperties(oldIndex); // Set some properties outItem.setPropertyAttributes(newAttributes); // Keep other properties unchanged return outItem; }
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
outItemFactory
filled with all necessary information for the
current operation
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.ISequentialInStream getStream(int index) throws SevenZipException
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.
index
- index of the item to read content of (starting from 0)
index
. Return
null
for archive items without content (for example, for directories)
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.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |