Package net.sf.sevenzipjbinding
Interface IOutUpdateArchive<T extends IOutItemBase>
- Type Parameters:
T- the type of the corresponding archive item data class (out item), likeIOutItem7zorIOutItemZip. UseIOutItemAllFormatsinterface to support all available archive formats.
- All Superinterfaces:
IOutArchiveBase
- All Known Subinterfaces:
IOutArchive<T>,IOutUpdateArchive7z,IOutUpdateArchiveBZip2,IOutUpdateArchiveGZip,IOutUpdateArchiveTar,IOutUpdateArchiveXz,IOutUpdateArchiveZip
- All Known Implementing Classes:
OutArchive7zImpl,OutArchiveBZip2Impl,OutArchiveGZipImpl,OutArchiveImpl,OutArchiveTarImpl,OutArchiveXzImpl,OutArchiveZipImpl
The interface provides functionality to update an existing archive. The standard way to get the implementation is to
use
No explicit closing is necessary. A connected out-archive gets closed automatically when the corresponding in-archive gets closed.
IInArchive.getConnectedOutArchive() method like this:IInArchiveinArchive =SevenZip.openInArchive(ArchiveFormat.SEVEN_ZIP, inStream);IOutUpdateArchive<IOutItemAllFormats>outArchive = inArchive.getConnectedOutArchive(); if (outArchive instanceofIOutFeatureSetLevel) { ((IOutFeatureSetLevel)outArchive).setLevel(myLevel); } outArchive.updateItems(...); ... inArchive.close();
No explicit closing is necessary. A connected out-archive gets closed automatically when the corresponding in-archive gets closed.
- Since:
- 9.20-2.00
- Author:
- Boris Brodski
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionReturn the archive format of this out-archive instanceGet connectedIInArchivefor update operations.voidupdateItems(ISequentialOutStream outStream, int numberOfItems, IOutCreateCallback<T> outCreateCallback) Update items in archive (actually creating a new one based on the old one).Methods inherited from interface net.sf.sevenzipjbinding.IOutArchiveBase
getTracePrintStream, isTrace, setTrace, setTracePrintStream
-
Method Details
-
updateItems
void updateItems(ISequentialOutStream outStream, int numberOfItems, IOutCreateCallback<T> outCreateCallback) throws SevenZipException Update items in archive (actually creating a new one based on the old one).- Parameters:
outStream- output stream to get the new archivenumberOfItems- number of items in the new archiveoutCreateCallback- create call back object to provide more information for archive update operation.- Throws:
SevenZipException- 7-Zip or 7-Zip-JBinding error occurs. UseSevenZipException.printStackTraceExtended()to get stack traces of this SevenZipException and of all thrown 'caused by' exceptions.
-
getArchiveFormat
ArchiveFormat getArchiveFormat()Return the archive format of this out-archive instance- Returns:
- the archive format of this out-archive instance
-
getConnectedInArchive
IInArchive getConnectedInArchive()Get connectedIInArchivefor update operations.- Returns:
- connected
IInArchivefor update operations
-