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 <T extends ArchiveInputStream<? extends E>,E extends ArchiveEntry>
TcreateArchiveInputStream(java.lang.String[] args, java.io.InputStream inputStream)
private static java.lang.String
detectFormat(java.io.File file)
private static void
list7z(java.io.File file)
private static void
listStream(java.io.File file, java.lang.String[] args)
private static void
listZipUsingTarFile(java.io.File file)
private static void
listZipUsingZipFile(java.io.File file)
static void
main(java.lang.String[] args)
Runs this class from the command line.private static void
usage()
-
-
-
Field Detail
-
FACTORY
private static final ArchiveStreamFactory FACTORY
-
-
Method Detail
-
createArchiveInputStream
private static <T extends ArchiveInputStream<? extends E>,E extends ArchiveEntry> T createArchiveInputStream(java.lang.String[] args, java.io.InputStream inputStream) throws ArchiveException
- Throws:
ArchiveException
-
detectFormat
private static java.lang.String detectFormat(java.io.File file) throws ArchiveException, java.io.IOException
- Throws:
ArchiveException
java.io.IOException
-
list7z
private static void list7z(java.io.File file) throws java.io.IOException
- Throws:
java.io.IOException
-
listStream
private static void listStream(java.io.File file, java.lang.String[] args) throws ArchiveException, java.io.IOException
- Throws:
ArchiveException
java.io.IOException
-
listZipUsingTarFile
private static void listZipUsingTarFile(java.io.File file) throws java.io.IOException
- Throws:
java.io.IOException
-
listZipUsingZipFile
private static void listZipUsingZipFile(java.io.File file) throws java.io.IOException
- Throws:
java.io.IOException
-
main
public static void main(java.lang.String[] args) throws ArchiveException, java.io.IOException
Runs this class from the command line.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.
- Parameters:
args
- name of the archive and optional argument archive type.- Throws:
ArchiveException
- Archiver related Exception.java.io.IOException
- an I/O exception.
-
usage
private static void usage()
-
-