Package net.sf.sevenzipjbinding.impl
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), likeIOutItem7zorIOutItemZip. UseIOutItemAllFormatsinterface to support all available archive formats. Return type for of the all create methods of the factory.
Factory for the
The purpose of the archive format specific interfaces
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 TypeMethodDescriptionCreate an instance of theE(IOutItemXxxinterface).
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 theE(IOutItemXxxinterface).
This method set default values for an existing archive item in update operations.createOutItemAndCloneProperties(int updateOldArchiveItemIndex) Create an instance of theE(IOutItemXxxinterface).
This method set default values for an existing archive item in update operations.
-
Method Details
-
createOutItem
Create an instance of theE(IOutItemXxxinterface).
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
Create an instance of theE(IOutItemXxxinterface).
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 theIOutCreateCallback.getItemInformation(int, OutItemFactory)method are suggested:- Return the created instance without further modification to copy the old archive item into the new archive as is.
- Setting
IOutItemBase.setUpdateIsNewData(Boolean)totrueand providing new data stream and data size. - Setting
IOutItemBase.setUpdateIsNewProperties(Boolean)totrueand setting all properties supported by the archive format
Note:usecreateOutItemAndCloneProperties(int)to change some of the properties
- 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. UseSevenZipException.printStackTraceExtended()to get stack traces of this SevenZipException and of all thrown 'caused by' exceptions.
-
createOutItemAndCloneProperties
Create an instance of theE(IOutItemXxxinterface).
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. UseSevenZipException.printStackTraceExtended()to get stack traces of this SevenZipException and of all thrown 'caused by' exceptions.
-