Class OutItemFactory<T extends IOutItemBase>

java.lang.Object
net.sf.sevenzipjbinding.impl.OutItemFactory<T>
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. Return type for of the all create methods of the factory.

public class OutItemFactory<T extends IOutItemBase> extends Object
Factory for the OutItem objects. The E type parameter references one of the archive format specific interfaces IOutItemXxx or the archive format independent interface IOutItemAllFormats to get access to subset of the OutItem methods.

The purpose of the archive format specific interfaces IOutItemXxx is to hide methods unrelated to the corresponding archive format. For example, GZip format doesn't support the attributes property and so the IOutItemGZip interface doesn't contain corresponding getters and setter. The Zip archive format on the other hand does support the attributes property defining the methods:
Since:
9.20-2.00
Author:
Boris Brodski
  • Method Summary

    Modifier and Type
    Method
    Description
    Create an instance of the E (IOutItemXxx interface).

    This method set default values for an archive item in create archive operations or a new archive item in update archive operations.
    createOutItem(int updateOldArchiveItemIndex)
    Create an instance of the E (IOutItemXxx interface).

    This method set default values for an existing archive item in update operations.
    createOutItemAndCloneProperties(int updateOldArchiveItemIndex)
    Create an instance of the E (IOutItemXxx interface).

    This method set default values for an existing archive item in update operations.

    Methods inherited from class java.lang.Object

    equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Method Details

    • createOutItem

      public T createOutItem()
      Create an instance of the E (IOutItemXxx interface).

      This method set default values for an archive item in create archive operations or a new archive item in update archive operations. For existing items in update archive operations use
      Returns:
      a new instance suitable for create archive operations
    • createOutItem

      public T createOutItem(int updateOldArchiveItemIndex) throws SevenZipException
      Create an instance of the E (IOutItemXxx interface).

      This method set default values for an existing archive item in update operations. The created object will be configured to remain old data and old properties.

      Following use cases within the IOutCreateCallback.getItemInformation(int, OutItemFactory) method are suggested:
      Parameters:
      updateOldArchiveItemIndex - index of the existing archive item in the existing (old) archive
      Returns:
      a new instance
      Throws:
      SevenZipException - 7-Zip or 7-Zip-JBinding error occurs. Use SevenZipException.printStackTraceExtended() to get stack traces of this SevenZipException and of all thrown 'caused by' exceptions.
    • createOutItemAndCloneProperties

      public T createOutItemAndCloneProperties(int updateOldArchiveItemIndex) throws SevenZipException
      Create an instance of the E (IOutItemXxx interface).

      This method set default values for an existing archive item in update operations. Also all properties of the old archive item get copied into the new instance and can be modified later on. This method is suitable to change some but not all of the properties of the old archive item during update operations.
      Parameters:
      updateOldArchiveItemIndex - index of the existing archive item in the existing (old) archive
      Returns:
      a new instance
      Throws:
      SevenZipException - 7-Zip or 7-Zip-JBinding error occurs. Use SevenZipException.printStackTraceExtended() to get stack traces of this SevenZipException and of all thrown 'caused by' exceptions.