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
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate static <T extends ArchiveInputStream<? extends E>,
E extends ArchiveEntry>
TcreateArchiveInputStream
(String[] args, InputStream inputStream) private static String
detectFormat
(File file) private static void
private static void
listStream
(File file, String[] args) private static void
listZipUsingTarFile
(File file) private static void
listZipUsingZipFile
(File file) static void
Runs this class from the command line.private static void
usage()
-
Field Details
-
FACTORY
-
-
Constructor Details
-
Lister
public Lister()
-
-
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:
ArchiveException
IOException
-
list7z
- Throws:
IOException
-
listStream
- Throws:
ArchiveException
IOException
-
listZipUsingTarFile
- Throws:
IOException
-
listZipUsingZipFile
- Throws:
IOException
-
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()
-