Class Lister
java.lang.Object
org.apache.commons.compress.archivers.Lister
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
FieldsModifier and TypeFieldDescriptionprivate final String[]private static final ArchiveStreamFactoryprivate final boolean -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate static <T extends ArchiveInputStream<? extends E>,E extends ArchiveEntry>
TcreateArchiveInputStream(String[] args, InputStream inputStream) private static StringdetectFormat(Path file) (package private) voidgo()private voidprivate voidprivate voidlistStream(Path file, String[] args) private voidlistZipUsingTarFile(Path file) private voidlistZipUsingZipFile(Path file) static voidRuns this class from the command line.private voidprivate voidprintln(ArchiveEntry entry) private static voidusage()
-
Field Details
-
FACTORY
-
quiet
private final boolean quiet -
args
-
-
Constructor Details
-
Lister
Deprecated.No replacement.Constructs a new instance. -
Lister
Lister(boolean quiet, String... args)
-
-
Method Details
-
createArchiveInputStream
private static <T extends ArchiveInputStream<? extends E>,E extends ArchiveEntry> T createArchiveInputStream(String[] args, InputStream inputStream) throws ArchiveException - Throws:
ArchiveException
-
detectFormat
- Throws:
ArchiveExceptionIOException
-
main
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.IOException- an I/O exception.
-
usage
private static void usage() -
go
- Throws:
ArchiveExceptionIOException
-
list
- Throws:
ArchiveExceptionIOException
-
list7z
- Throws:
IOException
-
listStream
- Throws:
ArchiveExceptionIOException
-
listZipUsingTarFile
- Throws:
IOException
-
listZipUsingZipFile
- Throws:
IOException
-
println
-
println
-