Package com.germinus.easyconf
Class ClasspathUtil
java.lang.Object
com.germinus.easyconf.ClasspathUtil
Contains util methods to search in the classpath
- Author:
- jferrer
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic 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.
-
Field Details
-
log
private static final Log log
-
-
Constructor Details
-
ClasspathUtil
public ClasspathUtil()
-
-
Method Details
-
locateClass
Return 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
Class
instance - Throws:
ClassNotFoundException
-
locateClasses
Return 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:
ClassNotFoundException
-
locateResource
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
null
if it has not been found
-
locateResource
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
null
if it has not been found
-