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.
Since:
4.65-1
Author:
Boris Brodski
See Also:
  • Method Details

    • getPath

      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 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.
      null will be returned, if current archive type doesn't support this property.
      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.
    • getSize

      Long getSize() throws SevenZipException
      Original (uncompressed) size of the item in bytes.
      Returns:
      original size of the item in bytes
      null will be returned, if the current archive type doesn't support this property.
      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.
    • getPackedSize

      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 occurs. Use SevenZipException.printStackTraceExtended() to get stack traces of this SevenZipException and of all thrown 'caused by' exceptions.
    • isFolder

      boolean isFolder() throws SevenZipException
      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:
      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 occurs. Use SevenZipException.printStackTraceExtended() to get stack traces of this SevenZipException and of all thrown 'caused by' exceptions.
    • getAttributes

      Integer getAttributes() throws SevenZipException
      Return item attributes.

      Supported by the following formats:
      • Zip
      • 7Z
      • Arj
      • Cab
      • Rar
      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 occurs. Use SevenZipException.printStackTraceExtended() to get stack traces of this SevenZipException and of all thrown 'caused by' exceptions.
    • getCreationTime

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

      Supported by the following formats:
      • 7Z
      • Rar
      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 occurs. Use SevenZipException.printStackTraceExtended() to get stack traces of this SevenZipException and of all thrown 'caused by' exceptions.
    • getLastAccessTime

      Date getLastAccessTime() throws SevenZipException
      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.
      null will be returned, if current archive type doesn't support this property.
      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.
    • getLastWriteTime

      Date getLastWriteTime() throws SevenZipException
      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
      null will be returned, if current archive type doesn't support this property.
      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.
    • isEncrypted

      boolean isEncrypted() throws SevenZipException
      Flag indicating whether the item is 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 occurs. Use SevenZipException.printStackTraceExtended() to get stack traces of this SevenZipException and of all thrown 'caused by' exceptions.
    • isCommented

      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 occurs. Use SevenZipException.printStackTraceExtended() to get stack traces of this SevenZipException and of all thrown 'caused by' exceptions.
    • getCRC

      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 occurs. Use SevenZipException.printStackTraceExtended() to get stack traces of this SevenZipException and of all thrown 'caused by' exceptions.
    • getMethod

      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 occurs. Use SevenZipException.printStackTraceExtended() to get stack traces of this SevenZipException and of all thrown 'caused by' exceptions.
    • getPosition

      Integer getPosition() throws SevenZipException
      Return the value of the item's POSITION property. This is a rarely used, format-specific property; for most archive formats it is not defined.
      Returns:
      value of the POSITION property
      null will be returned, if the current archive type doesn't support this property.
      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.
    • getHostOS

      String getHostOS() throws SevenZipException
      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.
      null will be returned, if current archive type doesn't support this property.
      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.
    • getUser

      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 occurs. Use SevenZipException.printStackTraceExtended() to get stack traces of this SevenZipException and of all thrown 'caused by' exceptions.
    • getGroup

      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 occurs. Use SevenZipException.printStackTraceExtended() to get stack traces of this SevenZipException and of all thrown 'caused by' exceptions.
    • getComment

      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 occurs. Use SevenZipException.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. Use sequentialOutStream to 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. Use SevenZipException.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. Use sequentialOutStream to output data.

      WARNING: this is a very slow operation when called repeatedly.
      Parameters:
      sequentialOutStream - output stream to use
      password - password to use
      Returns:
      result of operation
      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.
    • getItemIndex

      int getItemIndex()
      Returns the archive item index
      Returns:
      the archive item index