Example usage for org.apache.commons.compress.archivers.sevenz SevenZFile getEntries

List of usage examples for org.apache.commons.compress.archivers.sevenz SevenZFile getEntries

Introduction

In this page you can find the example usage for org.apache.commons.compress.archivers.sevenz SevenZFile getEntries.

Prototype

public Iterable<SevenZArchiveEntry> getEntries() 

Source Link

Document

Returns meta-data of all archive entries.

Usage

From source file:es.ucm.fdi.util.archive.SevenZipFormat.java

public ArrayList<String> list(File source) throws IOException {
    assertIs7Zip(source);/*from  ww  w.java 2 s.c  om*/

    SevenZFile zf = new SevenZFile(source);
    ArrayList<String> paths = new ArrayList<String>();

    for (SevenZArchiveEntry e : zf.getEntries()) {
        String name = FileUtils.toCanonicalPath(e.getName());
        if (e.isDirectory()) {
            continue;
        }

        paths.add(name);
    }
    return paths;
}