net.sf.sevenzipjbinding
Interface IOutUpdateArchive<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:
IOutArchiveBase
All Known Subinterfaces:
IOutArchive<T>, IOutUpdateArchive7z, IOutUpdateArchiveBZip2, IOutUpdateArchiveGZip, IOutUpdateArchiveTar, IOutUpdateArchiveZip
All Known Implementing Classes:
OutArchive7zImpl, OutArchiveBZip2Impl, OutArchiveGZipImpl, OutArchiveImpl, OutArchiveTarImpl, OutArchiveZipImpl

public interface IOutUpdateArchive<T extends IOutItemBase>
extends IOutArchiveBase

The interface provides functionality to update an existing archive. The standard way to get the implementation is to use IInArchive.getConnectedOutArchive() method like this:

  IInArchive inArchive = SevenZip.openInArchive(ArchiveFormat.SEVEN_ZIP, inStream);
  IOutUpdateArchive<IOutItem7z> outArchive = inArchive.openOutArchive();
  
  if (outArchive instanceof IOutFeatureSetLevel) {
      ((IOutFeatureSetLevel)outArchive).setLevel(myLevel);
  }
  
  outArchive.updateItems(...);
  ...
  
  inArchive.close();
 

No explicit closing is necessary. Connected out-archive get closed automatically when corresponding in-archive get closed.

Since:
9.20-2.0
Author:
Boris Brodski
See Also:
IInArchive, IOutItemBase, IOutItemAllFormats

Method Summary
 ArchiveFormat getArchiveFormat()
          Return archive format used with this instance of IOutStream
 IInArchive getConnectedInArchive()
          Get connected IInArchive for update operations.
 void updateItems(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 Detail

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 archive
numberOfItems - number of items in the new archive
outCreateCallback - create call back object to provide more information for archive update 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

getConnectedInArchive

IInArchive getConnectedInArchive()
Get connected IInArchive for update operations.

Returns:
connected IInArchive for update operations