Class Lister
- java.lang.Object
-
- org.apache.commons.compress.archivers.Lister
-
public final class Lister extends java.lang.Object
Simple command line application that lists the contents of an archive.The name of the archive must be given as a command line argument.
The optional second argument defines the archive type, in case the format is not recognized.
- Since:
- 1.1
-
-
Field Summary
Fields Modifier and Type Field Description private static ArchiveStreamFactory
factory
-
Constructor Summary
Constructors Constructor Description Lister()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description private static ArchiveInputStream
createArchiveInputStream(java.lang.String[] args, java.io.InputStream fis)
private static java.lang.String
detectFormat(java.io.File f)
private static void
list7z(java.io.File f)
private static void
listStream(java.io.File f, java.lang.String[] args)
private static void
listZipUsingZipFile(java.io.File f)
static void
main(java.lang.String[] args)
private static void
usage()
-
-
-
Field Detail
-
factory
private static final ArchiveStreamFactory factory
-
-
Method Detail
-
main
public static void main(java.lang.String[] args) throws java.lang.Exception
- Throws:
java.lang.Exception
-
listStream
private static void listStream(java.io.File f, java.lang.String[] args) throws ArchiveException, java.io.IOException
- Throws:
ArchiveException
java.io.IOException
-
createArchiveInputStream
private static ArchiveInputStream createArchiveInputStream(java.lang.String[] args, java.io.InputStream fis) throws ArchiveException
- Throws:
ArchiveException
-
detectFormat
private static java.lang.String detectFormat(java.io.File f) throws ArchiveException, java.io.IOException
- Throws:
ArchiveException
java.io.IOException
-
list7z
private static void list7z(java.io.File f) throws ArchiveException, java.io.IOException
- Throws:
ArchiveException
java.io.IOException
-
listZipUsingZipFile
private static void listZipUsingZipFile(java.io.File f) throws ArchiveException, java.io.IOException
- Throws:
ArchiveException
java.io.IOException
-
usage
private static void usage()
-
-