public class ClasspathUtil extends Object
| Constructor and Description |
|---|
ClasspathUtil() |
| Modifier and Type | Method and Description |
|---|---|
static Class |
locateClass(String name)
Return the Class object of the specified class name by searching the
current classpath and the system classpath.
|
static Class[] |
locateClasses(String[] classNames)
Return an array of Class objects for each of the class names specified.
|
static URL |
locateResource(String name)
Return the location of the specified resource by searching the user home
directory, the current classpath and the system classpath.
|
static URL |
locateResource(String base,
String name)
Return the location of the specified resource by searching the user home
directory, the current classpath and the system classpath.
|
public static Class locateClass(String name) throws ClassNotFoundException
name - the name of the classClass instanceClassNotFoundExceptionpublic static Class[] locateClasses(String[] classNames) throws ClassNotFoundException
classNames - the names of the classes to loadClass[] arrayClassNotFoundExceptionpublic static URL locateResource(String base, String name)
base - the base path of the resourcename - the name of the resourcenull if it has not
been foundpublic static URL locateResource(String name)
name - the name of the resourcenull if it has not
been foundCopyright © 2020. All Rights Reserved.