net.sf.sevenzipjbinding.simple
Interface ISimpleInArchiveItem

All Known Implementing Classes:
SimpleInArchiveItemImpl

public interface ISimpleInArchiveItem

This java interface represents a archive item. There are no corresponding interface in original SevenZip api.

This interface is a part of simplified 7-Zip-JBinding interface.

NOTE: Some properties my only be available after the extraction operation completes.
Example: PACKED_SIZE of the LZMA archives.

Since:
4.65-1
Author:
Boris Brodski
See Also:
ISimpleInArchive

Method Summary
 ExtractOperationResult extractSlow(ISequentialOutStream sequentialOutStream)
          Extract one archive item.
 ExtractOperationResult extractSlow(ISequentialOutStream sequentialOutStream, java.lang.String password)
          Extract one archive item.
 java.lang.Integer getAttributes()
          Return item attributes.

Supported by all methods Zip 7Z Arj Cab Rar
 java.lang.String getComment()
          Return comments for the item.
 java.lang.Integer getCRC()
          Return CRC checksum of the item content.
 java.util.Date getCreationTime()
          Return creation date and time of the item.

Supported by all methods 7Z Rar
 java.lang.String getGroup()
          Return parent group of the item.
 java.lang.String getHostOS()
          Return host OS of item.
 int getItemIndex()
          Returns the archive item index
 java.util.Date getLastAccessTime()
          Return last access date and time of the item.

Supported by all methods 7Z Rar
 java.util.Date getLastWriteTime()
          Return last write date and time of the item.

Supported by all methods, but BZ2 Chm RPM Split Z
 java.lang.String getMethod()
          Return string title of item compress method.
 java.lang.Long getPackedSize()
          Size of the packed item in archive.
 java.lang.String getPath()
          Full path, name and extension of the file inside the archive.
 java.lang.Integer getPosition()
          TODO: the purpose of position isn't clear
 java.lang.Long getSize()
          Original size of the item.
 java.lang.String getUser()
          Return parent user of the item.
 java.lang.Boolean isCommented()
          Return true if item was commented, otherwise false.
 boolean isEncrypted()
          Flag either a item encrypted or not.
 boolean isFolder()
          Returns flag either a item represents a folder or not.
 

Method Detail

getPath

java.lang.String getPath()
                         throws SevenZipException
Full path, name and extension of the file inside the archive. Example. 'dir/file.ext'. Please note, that stream archive formats such as gzip does not support this property, since it is always a single file (or stream) being compressed.

Returns:
full path, name and extension of the item in archive.
null will be returned, if current archive type doesn't support this property.
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.

getSize

java.lang.Long getSize()
                       throws SevenZipException
Original size of the item. -1 is returned, if no size known for this item.

Returns:
Original size of the item or -1
null will be returned, if current archive type doesn't support this property.
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.

getPackedSize

java.lang.Long getPackedSize()
                             throws SevenZipException
Size of the packed item in archive. Sometimes 0 will 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
null will be returned, if current archive type doesn't support this property.
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.

isFolder

boolean isFolder()
                 throws SevenZipException
Returns flag either a item represents a folder or not. Please note, that some archive formats doesn't define special items for folders. In this case you may get a item with a path 'dir/file' without having an item for 'dir' at all.

Returns:
true if item is a folder, otherwise false. false is returned, if archive format doesn't support this property.
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.

getAttributes

java.lang.Integer getAttributes()
                                throws SevenZipException
Return item attributes.

Supported by all methods

Returns:
attributes of item
null will be returned, if current archive type doesn't support this property.
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.

getCreationTime

java.util.Date getCreationTime()
                               throws SevenZipException
Return creation date and time of the item.

Supported by all methods

Returns:
creation date and time of the item
null will be returned, if current archive type doesn't support this property.
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.

getLastAccessTime

java.util.Date getLastAccessTime()
                                 throws SevenZipException
Return last access date and time of the item.

Supported by all methods

Returns:
last access date and time of the item.
null will be returned, if current archive type doesn't support this property.
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.

getLastWriteTime

java.util.Date getLastWriteTime()
                                throws SevenZipException
Return last write date and time of the item.

Supported by all methods, but

Returns:
last write date and time of the item
null will be returned, if current archive type doesn't support this property.
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.

isEncrypted

boolean isEncrypted()
                    throws SevenZipException
Flag either a item encrypted or not.

Returns:
true if item is encrypted, otherwise false. false is returned, if archive format doesn't support this property.
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.

isCommented

java.lang.Boolean isCommented()
                              throws SevenZipException
Return true if item was commented, otherwise false.

Returns:
true if item was commented, otherwise false.
null will be returned, if current archive type doesn't support this property.
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.

getCRC

java.lang.Integer getCRC()
                         throws SevenZipException
Return CRC checksum of the item content.

Returns:
CRC checksum of the item content
null will be returned, if current archive type doesn't support this property.
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.

getMethod

java.lang.String getMethod()
                           throws SevenZipException
Return string title of item compress method.

Returns:
string title of item compress method
null will be returned, if current archive type doesn't support this property.
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.

getPosition

java.lang.Integer getPosition()
                              throws SevenZipException
TODO: the purpose of position isn't clear

Returns:
TODO
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.

getHostOS

java.lang.String getHostOS()
                           throws SevenZipException
Return host OS of item. TODO: The meaning of the hostOS property is unknown

Returns:
host OS of item.
null will be returned, if current archive type doesn't support this property.
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.

getUser

java.lang.String getUser()
                         throws SevenZipException
Return parent user of the item.

Returns:
parent user of the item.
null will be returned, if current archive type doesn't support this property.
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.

getGroup

java.lang.String getGroup()
                          throws SevenZipException
Return parent group of the item.

Returns:
parent group of the item.
null will be returned, if current archive type doesn't support this property.
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.

getComment

java.lang.String getComment()
                            throws SevenZipException
Return comments for the item.

Returns:
comments for the item.
null will be returned, if current archive type doesn't support this property.
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.

extractSlow

ExtractOperationResult extractSlow(ISequentialOutStream sequentialOutStream)
                                   throws SevenZipException
Extract one archive item. Use sequentialOutStream to output data.

WARNING: this is very slow operation for multiple calls.

Parameters:
sequentialOutStream - output stream to use
Returns:
result of 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.

extractSlow

ExtractOperationResult extractSlow(ISequentialOutStream sequentialOutStream,
                                   java.lang.String password)
                                   throws SevenZipException
Extract one archive item. Use sequentialOutStream to output data.

WARNING: this is very slow operation for multiple calls.

Parameters:
sequentialOutStream - output stream to use
password - password to use
Returns:
result of 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.

getItemIndex

int getItemIndex()
Returns the archive item index

Returns:
the archive item index