Search in sources :

Example 1 with WrapperArchiveEntryIterator

use of com.mucommander.commons.file.archive.WrapperArchiveEntryIterator in project mucommander by mucommander.

the class SevenZipArchiveFile method getEntryIterator.

@Override
public ArchiveEntryIterator getEntryIterator() throws IOException {
    final IInArchive sevenZipFile = openSevenZipFile();
    try {
        int nbEntries = sevenZipFile.size();
        Vector<ArchiveEntry> entries = new Vector<ArchiveEntry>();
        for (int i = 0; i < nbEntries; i++) entries.add(createArchiveEntry(sevenZipFile.getEntry(i)));
        return new WrapperArchiveEntryIterator(entries.iterator());
    } finally {
    /*try { sevenZipFile.close(); }
            catch(IOException e) {
                // Not much we can do about it
            }*/
    }
}
Also used : IInArchive(com.mucommander.commons.file.archive.sevenzip.provider.SevenZip.Archive.IInArchive) WrapperArchiveEntryIterator(com.mucommander.commons.file.archive.WrapperArchiveEntryIterator) ArchiveEntry(com.mucommander.commons.file.archive.ArchiveEntry) Vector(java.util.Vector)

Aggregations

ArchiveEntry (com.mucommander.commons.file.archive.ArchiveEntry)1 WrapperArchiveEntryIterator (com.mucommander.commons.file.archive.WrapperArchiveEntryIterator)1 IInArchive (com.mucommander.commons.file.archive.sevenzip.provider.SevenZip.Archive.IInArchive)1 Vector (java.util.Vector)1