public class ClasspathUtils extends Object
| Modifier and Type | Field and Description |
|---|---|
private static org.apache.log4j.Logger |
logger
Class specific logger.
|
private static Class[] |
parameters
Parameters for the URL class loader.
|
| Constructor and Description |
|---|
ClasspathUtils() |
| Modifier and Type | Method and Description |
|---|---|
static void |
addDirToClasspath(File rootDirectory)
Recursively searches for
jar files in the given root
directory and adds them to the classpath. |
static void |
addURL(URL url)
Adds an
URL to the classpath. |
static String |
getRelativePathToDir(String path,
String rootDir)
Extracts a relative path starting with the
rootDir name from
a given path. |
private static org.apache.log4j.Logger logger
private static final Class[] parameters
public static void addDirToClasspath(File rootDirectory) throws IOException
jar files in the given root
directory and adds them to the classpath.rootDirectory - IOExceptionpublic static void addURL(URL url) throws IOException
URL to the classpath.url - URLIOException - IOExceptionpublic static String getRelativePathToDir(String path, String rootDir)
rootDir name from
a given path.path - a path to be searched inrootDir - a directory to use as new root in the resulting path/relative/path from
/Path/to/my/relative/path, if relative
is given as rootDirCopyright © 2009–2017 Helmut Ahammer, Philipp Kainz. All rights reserved.