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.

Version:
4.65-1
Author:
Boris Brodski

Constructor Summary
SimpleInArchiveImpl(ISevenZipInArchive sevenZipInArchive)
          Constructing an instance of SimpleInArchiveImpl from a instance of ISevenZipInArchive.
 
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.
 ISevenZipInArchive 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(ISevenZipInArchive sevenZipInArchive)
Constructing an instance of SimpleInArchiveImpl from a instance of ISevenZipInArchive.

Parameters:
sevenZipInArchive - a base instance of ISevenZipInArchive
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 - intern error occurs. See Throwable.getMessage() for details.

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 - error occurs. See Throwable.getMessage() for details.

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 - error occurs. See Throwable.getMessage() for details.

testAndGetSafeSevenZipInArchive

public ISevenZipInArchive 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 - error occurs. See Throwable.getMessage() for details.