Package info.freelibrary.util
Class JarUtils
- java.lang.Object
-
- info.freelibrary.util.JarUtils
-
public final class JarUtils extends Object
A small collection of Jar file utilities.
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static void
extract(File aJarFile, String aFilePath, File aDestDir)
Extract a particular path from a supplied Jar file to a suppliedFile
location.static void
extract(String aJarFilePath, String aFilePath, File aDestDir)
Extract a particular path from a supplied Jar file to a suppliedFile
location.static void
extract(JarFile aJarFile, String aFilePath, File aDestDir)
Extract a particular path from a supplied Jar file to a suppliedFile
location.static URL[]
getJarURLs()
Gets a list of jar files in the classpath (this includes jars in jars, one level deep).
-
-
-
Method Detail
-
getJarURLs
public static URL[] getJarURLs() throws IOException
Gets a list of jar files in the classpath (this includes jars in jars, one level deep).- Returns:
- An array of
URL
s found in the classpath - Throws:
IOException
- If there is trouble reading the classpath
-
extract
public static void extract(String aJarFilePath, String aFilePath, File aDestDir) throws IOException
Extract a particular path from a supplied Jar file to a suppliedFile
location.- Parameters:
aJarFilePath
- A path to a Jar file from which to extractaFilePath
- The Jar file path of the file to extractaDestDir
- The destination directory into which the file should be extracted- Throws:
IOException
- If there is an exception thrown while reading or writing the file
-
extract
public static void extract(File aJarFile, String aFilePath, File aDestDir) throws IOException
Extract a particular path from a supplied Jar file to a suppliedFile
location.- Parameters:
aJarFile
- A Jar file from which to extractaFilePath
- The Jar file path of the file to extractaDestDir
- The destination directory into which the file should be extracted- Throws:
IOException
- If there is an exception thrown while reading or writing the file
-
extract
public static void extract(JarFile aJarFile, String aFilePath, File aDestDir) throws IOException
Extract a particular path from a supplied Jar file to a suppliedFile
location.- Parameters:
aJarFile
- A Jar file from which to extractaFilePath
- The Jar file path of the file to extractaDestDir
- The destination directory into which the file should be extracted- Throws:
IOException
- If there is an exception thrown while reading or writing the file
-
-