|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.neeve.util.UtlJar
public class UtlJar
Utilities for working with jar files.
This class MAY be used by end users, however it is not supported.
Constructor Summary | |
---|---|
UtlJar()
|
Method Summary | |
---|---|
static void |
extractClasspathToDirectory(ClassLoader loader,
File outputDir)
Extracts the current classpath to the given folder as loose files. |
static void |
extractFolder(URL jarUrl,
String folderName,
File targetFolder)
Extract a folder from a jar. |
static void |
jar(File source,
File target)
Jars the given directory. |
static void |
listFiles(URL jarFolderUrl,
Set<URL> results,
UtlResource.URLFilter filter)
From a jar url of jar:[jar-path.jar]! |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public UtlJar()
Method Detail |
---|
public static void extractFolder(URL jarUrl, String folderName, File targetFolder) throws IOException
If the target folder does not exist, it and any subdirectories will be created as needed. Existing files in the target folder that are extracted will be overwritten, but other files already in the target folder path will be preserved.
jarUrl
- The location of the jar.folderName
- The folder name in the jar that should be extracted.targetFolder
- The target directory to which to extract.
IOException
- If there is an I/O error extracting from the jar.public static final void extractClasspathToDirectory(ClassLoader loader, File outputDir) throws IOException
loader
- The ClassLoader
from which to extract class files.outputDir
- The target directory
IOException
- If there is an error extracting the classpath.
IllegalArgumentException
- If the ClassLoader
type is not supported.public static final void jar(File source, File target) throws IOException
source
- The source directory.target
- The target jar file.
IOException
- If there is an error creating the jar.public static void listFiles(URL jarFolderUrl, Set<URL> results, UtlResource.URLFilter filter) throws IOException
jarFolderUrl
- The url of the jar including the folder name in which to look.results
- The set into which to place the listed files.filter
- An optional filter that can be used to filter files from being added to the results
IOException
- If there is an error listing the files in the jar.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |