Class 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
    • 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()  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • Lister

        public Lister()
    • 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
      • detectFormat

        private static java.lang.String detectFormat​(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()