org.apache.commons.discovery.tools
public class ResourceUtils extends Object
Method Summary | |
---|---|
static String | getPackageName(Class clazz)
Get package name.
|
static Resource | getResource(Class spi, String resourceName, ClassLoaders loaders)
Load the resource resourceName .
|
static Properties | loadProperties(Class spi, String propertiesFileName, ClassLoaders classLoaders)
Load named property file, optionally qualifed by spi's package name
as per Class.getResource.
|
resourceName
.
Try each classloader in succession,
until first succeeds, or all fail.
If all fail and resouceName
is not absolute
(doesn't start with '/' character), then retry with
packageName/resourceName
after changing all
'.' to '/'.
Parameters: resourceName The name of the resource to load.
Parameters: propertiesFileName The property file name.
Returns: Instance of a class implementing the SPI.
Throws: DiscoveryException Thrown if the name of a class implementing the SPI cannot be found, if the class cannot be loaded and instantiated, or if the resulting class does not implement (or extend) the SPI.
UNKNOWN: