Package com.germinus.easyconf
Class ClasspathUtil
- java.lang.Object
-
- com.germinus.easyconf.ClasspathUtil
-
public class ClasspathUtil extends java.lang.ObjectContains util methods to search in the classpath- Author:
- jferrer
-
-
Field Summary
Fields Modifier and Type Field Description private static Loglog
-
Constructor Summary
Constructors Constructor Description ClasspathUtil()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static java.lang.ClasslocateClass(java.lang.String name)Return the Class object of the specified class name by searching the current classpath and the system classpath.static java.lang.Class[]locateClasses(java.lang.String[] classNames)Return an array of Class objects for each of the class names specified.static java.net.URLlocateResource(java.lang.String name)Return the location of the specified resource by searching the user home directory, the current classpath and the system classpath.static java.net.URLlocateResource(java.lang.String base, java.lang.String name)Return the location of the specified resource by searching the user home directory, the current classpath and the system classpath.
-
-
-
Method Detail
-
locateClass
public static java.lang.Class locateClass(java.lang.String name) throws java.lang.ClassNotFoundExceptionReturn the Class object of the specified class name by searching the current classpath and the system classpath.- Parameters:
name- the name of the class- Returns:
- the
Classinstance - Throws:
java.lang.ClassNotFoundException
-
locateClasses
public static java.lang.Class[] locateClasses(java.lang.String[] classNames) throws java.lang.ClassNotFoundExceptionReturn an array of Class objects for each of the class names specified. Each class will be searched for using the locateClass method. If any of the class names does not exist a ClassNotFoundException will be thrown- Parameters:
classNames- the names of the classes to load- Returns:
- the
Class[]array - Throws:
java.lang.ClassNotFoundException
-
locateResource
public static java.net.URL locateResource(java.lang.String base, java.lang.String name)Return the location of the specified resource by searching the user home directory, the current classpath and the system classpath.- Parameters:
base- the base path of the resourcename- the name of the resource- Returns:
- the location of the resource or
nullif it has not been found
-
locateResource
public static java.net.URL locateResource(java.lang.String name)
Return the location of the specified resource by searching the user home directory, the current classpath and the system classpath.- Parameters:
name- the name of the resource- Returns:
- the location of the resource or
nullif it has not been found
-
-