Package generic.io

Class JarReader


  • public class JarReader
    extends java.lang.Object
    JarReader is a class for reading from a jar input stream.
    • Field Summary

      Fields 
      ChangeModifier and Type Field Description
      NEWprotected java.util.jar.JarInputStream jarIn  
    • Constructor Summary

      Constructors 
      ChangeConstructor Description
      JarReader​(java.util.jar.JarInputStream jarIn)
      Creates a JarReader
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      ChangeModifier and Type Method Description
      void createRecursively​(java.lang.String basePath, TaskMonitor monitor)
      Recursively reads the files from the jar input stream and creates the respetive directories and files in the file system.
      java.util.jar.JarInputStream getJarInputStream()
      Return the jar input stream being used by this JarReader.
      • Methods inherited from class java.lang.Object

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

      • jarIn NEW

        protected java.util.jar.JarInputStream jarIn

Constructor Detail

  • Method Detail

    • createRecursively

      public void createRecursively​(java.lang.String basePath,
                                    TaskMonitor monitor)
                             throws java.io.FileNotFoundException,
                                    java.io.IOException
      Recursively reads the files from the jar input stream and creates the respetive directories and files in the file system.

      It effectively unzips the Jar file. Warning: This will overwrite any files that already exist on the file system as it outputs the jar contents.

      Parameters:
      basePath - the base path for where to output the JarInputStream file contents to.
      Throws:
      java.io.FileNotFoundException - if the file exists but is a directory rather than a regular file, does not exist but cannot be created, or cannot be opened for any other reason
      java.io.IOException - if it can't read the jar file or output one or more of its files.
    • getJarInputStream

      public java.util.jar.JarInputStream getJarInputStream()
      Return the jar input stream being used by this JarReader.