|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectclasspathhelper.search.JarFinder
Class that looks for jars relative to a root directory. The searching can optionally skip a provided classpath, in effect returning jars not on the classpath.
JarFinder jarFinder = new JarFinder();
File[] jars = jarFinder.findJarsUnderDir( new File("root"));
// or, to ignore jars already on a classpath
File[] jars2 = jarFinder.findJarsUnderDir( new File("root"), "jar1;jar2");
| Constructor Summary | |
JarFinder()
|
|
| Method Summary | |
java.io.File[] |
findJarsUnderDir(java.io.File dir)
Finds jar files under the root dir. |
protected void |
findJarsUnderDir(java.io.File dir,
java.util.Collection ignore,
java.util.Set retVal)
Internal method that handles the recursion of searching for jars. |
java.io.File[] |
findJarsUnderDir(java.io.File dir,
java.lang.String ignoreClassPath)
Finds jar files under the root dir, ignoring jars on the supplied classpath. |
protected java.util.Collection |
parsePath(java.lang.String path)
Internal method that parses a classpath like string into a collection of file objects. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public JarFinder()
| Method Detail |
public java.io.File[] findJarsUnderDir(java.io.File dir)
throws java.io.IOException
dir - The root directory.
java.io.IOException - If any I/O related errors occur.
public java.io.File[] findJarsUnderDir(java.io.File dir,
java.lang.String ignoreClassPath)
throws java.io.IOException
dir - The root directory.ignoreClassPath - A classpath string containing jars that will be
ignored (class directories on classpath are also ignored).
java.io.IOException - If any I/O related errors occur.
protected void findJarsUnderDir(java.io.File dir,
java.util.Collection ignore,
java.util.Set retVal)
throws java.io.IOException
findJarsUnderDir methods.
dir - The root directory.ignore - A collection of File objects that represent files we will
ignore.retVal - The return value where found jar files will be added.
java.io.IOException - If any I/O related errors occur.protected java.util.Collection parsePath(java.lang.String path)
path - The class path. (directory/files seperated by
File.pathSeparator).
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||