Package generic.io
Class JarReader
- java.lang.Object
-
- generic.io.JarReader
-
public class JarReader extends java.lang.ObjectJarReader is a class for reading from a jar input stream.
-
-
Field Summary
Fields Modifier and Type Field Description protected java.util.jar.JarInputStreamjarIn
-
Constructor Summary
Constructors Constructor Description JarReader(java.util.jar.JarInputStream jarIn)Creates a JarReader
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidcreateRecursively(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.JarInputStreamgetJarInputStream()Return the jar input stream being used by this JarReader.
-
-
-
Method Detail
-
createRecursively
public void createRecursively(java.lang.String basePath, TaskMonitor monitor) throws java.io.FileNotFoundException, java.io.IOExceptionRecursively 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 reasonjava.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.
-
-