Package net.sf.sevenzipjbinding.simple
Interface ISimpleInArchiveItem
- All Known Implementing Classes:
SimpleInArchiveItemImpl
public interface ISimpleInArchiveItem
This Java interface represents an archive item. There is no corresponding interface in the original SevenZip API.
This interface is a part of the simplified 7-Zip-JBinding interface.
NOTE: Some properties may only be available after the extraction operation completes.
Example: PACKED_SIZE of the LZMA archives.
This interface is a part of the simplified 7-Zip-JBinding interface.
NOTE: Some properties may only be available after the extraction operation completes.
Example: PACKED_SIZE of the LZMA archives.
- Since:
- 4.65-1
- Author:
- Boris Brodski
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionextractSlow(ISequentialOutStream sequentialOutStream) Extract one archive item.extractSlow(ISequentialOutStream sequentialOutStream, String password) Extract one archive item.Return item attributes.
Supported by the following formats:Zip7ZArjCabRarReturn comments for the item.getCRC()Return CRC checksum of the item content.Return creation date and time of the item.
Supported by the following formats:7ZRargetGroup()Return parent group of the item.Return the host operating system recorded for the item, i.e.intReturns the archive item indexReturn last access date and time of the item.
Supported by the following formats:7ZRarReturn last write date and time of the item.
Supported by all formats except the following:BZ2ChmRPMSplitZReturn string title of item compress method.Size of the packed item in archive.getPath()Full path, name and extension of the file inside the archive.Return the value of the item'sPOSITIONproperty.getSize()Original (uncompressed) size of the item in bytes.getUser()Return parent user of the item.Returntrueif item was commented, otherwisefalse.booleanFlag indicating whether the item is encrypted or not.booleanisFolder()Returns a flag indicating whether the item represents a folder or not.
-
Method Details
-
getPath
Full path, name and extension of the file inside the archive. Example:'dir/file.ext'. Please note that stream archive formats such as gzip do not support this property, since they always compress a single file (or stream).- Returns:
- full path, name and extension of the item in archive.
nullwill be returned, if current archive type doesn't support this property. - 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.
-
getSize
Original (uncompressed) size of the item in bytes.- Returns:
- original size of the item in bytes
nullwill be returned, if the current archive type doesn't support this property. - 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.
-
getPackedSize
Size of the packed item in archive. Sometimes0will be returned. It means either unknown or the item shares compressed data with other items and so take no additional space in archive.- Returns:
- packed size of item in archive
nullwill be returned, if current archive type doesn't support this property. - 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.
-
isFolder
Returns a flag indicating whether the item represents a folder or not. Please note that some archive formats do not define special items for folders. In this case you may get an item with a path'dir/file'without having an item for'dir'at all.
- Returns:
trueif item is a folder, otherwisefalse.falseis returned, if archive format doesn't support this property.- 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.
-
getAttributes
Return item attributes.
Supported by the following formats:-
Zip -
7Z -
Arj -
Cab -
Rar
- Returns:
- attributes of item
nullwill be returned, if current archive type doesn't support this property. - 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.
-
-
getCreationTime
Return creation date and time of the item.
Supported by the following formats:-
7Z -
Rar
- Returns:
- creation date and time of the item
nullwill be returned, if current archive type doesn't support this property. - 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.
-
-
getLastAccessTime
Return last access date and time of the item.
Supported by the following formats:-
7Z -
Rar
- Returns:
- last access date and time of the item.
nullwill be returned, if current archive type doesn't support this property. - 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.
-
-
getLastWriteTime
Return last write date and time of the item.
Supported by all formats except the following:-
BZ2 -
Chm -
RPM -
Split -
Z
- Returns:
- last write date and time of the item
nullwill be returned, if current archive type doesn't support this property. - 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.
-
-
isEncrypted
Flag indicating whether the item is encrypted or not.- Returns:
trueif item is encrypted, otherwisefalse.falseis returned, if archive format doesn't support this property.- 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.
-
isCommented
Returntrueif item was commented, otherwisefalse.- Returns:
trueif item was commented, otherwisefalse.
nullwill be returned, if current archive type doesn't support this property.- 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.
-
getCRC
Return CRC checksum of the item content.- Returns:
- CRC checksum of the item content
nullwill be returned, if current archive type doesn't support this property. - 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.
-
getMethod
Return string title of item compress method.- Returns:
- string title of item compress method
nullwill be returned, if current archive type doesn't support this property. - 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.
-
getPosition
Return the value of the item'sPOSITIONproperty. This is a rarely used, format-specific property; for most archive formats it is not defined.- Returns:
- value of the
POSITIONproperty
nullwill be returned, if the current archive type doesn't support this property. - 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.
-
getHostOS
Return the host operating system recorded for the item, i.e. the operating system on which the item was added to the archive. This is mainly relevant for formats such as Zip and RAR.- Returns:
- host OS of the item.
nullwill be returned, if current archive type doesn't support this property. - 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.
-
getUser
Return parent user of the item.- Returns:
- parent user of the item.
nullwill be returned, if current archive type doesn't support this property. - 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.
-
getGroup
Return parent group of the item.- Returns:
- parent group of the item.
nullwill be returned, if current archive type doesn't support this property. - 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.
-
getComment
Return comments for the item.- Returns:
- comments for the item.
nullwill be returned, if current archive type doesn't support this property. - 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.
-
extractSlow
ExtractOperationResult extractSlow(ISequentialOutStream sequentialOutStream) throws SevenZipException Extract one archive item. UsesequentialOutStreamto output data.
WARNING: this is a very slow operation when called repeatedly.- Parameters:
sequentialOutStream- output stream to use- Returns:
- result of 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.
-
extractSlow
ExtractOperationResult extractSlow(ISequentialOutStream sequentialOutStream, String password) throws SevenZipException Extract one archive item. UsesequentialOutStreamto output data.
WARNING: this is a very slow operation when called repeatedly.- Parameters:
sequentialOutStream- output stream to usepassword- password to use- Returns:
- result of 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.
-
getItemIndex
int getItemIndex()Returns the archive item index- Returns:
- the archive item index
-