net.sf.sevenzipjbinding.simple.impl
Class SimpleInArchiveImpl

java.lang.Object
  extended by net.sf.sevenzipjbinding.simple.impl.SimpleInArchiveImpl
All Implemented Interfaces:
ISimpleInArchive

public class SimpleInArchiveImpl
extends java.lang.Object
implements ISimpleInArchive

Standard implementation of ISimpleInArchive, simplified 7-Zip-JBinding interface.

Since:
4.65-1
Author:
Boris Brodski

Constructor Summary
SimpleInArchiveImpl(IInArchive sevenZipInArchive)
          Constructing an instance of SimpleInArchiveImpl from a instance of IInArchive.
 
Method Summary
 void close()
          Close archive.
 ISimpleInArchiveItem getArchiveItem(int index)
          $Return a simple representation of the archive item with index index.
 ISimpleInArchiveItem[] getArchiveItems()
          Return array of archive items with ISimpleInArchive.getNumberOfItems() elements.
 int getNumberOfItems()
          Return count of items in archive.
 IInArchive testAndGetSafeSevenZipInArchive()
          Tests, if 7-Zip In archive interface can be accessed safely.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SimpleInArchiveImpl

public SimpleInArchiveImpl(IInArchive sevenZipInArchive)
Constructing an instance of SimpleInArchiveImpl from a instance of IInArchive.

Parameters:
sevenZipInArchive - a base instance of IInArchive
Method Detail

close

public void close()
           throws SevenZipException
Close archive. No more archive operations are possible.
Note: This method should be always called to free system resources.

Specified by:
close in interface ISimpleInArchive
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.

getArchiveItems

public ISimpleInArchiveItem[] getArchiveItems()
                                       throws SevenZipException
Return array of archive items with ISimpleInArchive.getNumberOfItems() elements.

Specified by:
getArchiveItems in interface ISimpleInArchive
Returns:
array of archive items
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.

getNumberOfItems

public int getNumberOfItems()
                     throws SevenZipException
Return count of items in archive.

Specified by:
getNumberOfItems in interface ISimpleInArchive
Returns:
count of item in archive.
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.

testAndGetSafeSevenZipInArchive

public IInArchive testAndGetSafeSevenZipInArchive()
                                           throws SevenZipException
Tests, if 7-Zip In archive interface can be accessed safely.

Returns:
7-Zip In archive interface
Throws:
SevenZipException - archive can't be accessed any more

getArchiveItem

public ISimpleInArchiveItem getArchiveItem(int index)
                                    throws SevenZipException
$Return a simple representation of the archive item with index index.

Specified by:
getArchiveItem in interface ISimpleInArchive
Parameters:
index - index of the archive item to return
Returns:
corresponding instance of ISimpleInArchiveItem
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.