private void load(String resourceName,String configName) {
try {
if ( configName == null ) {
configName = "default";
}
ConfigurationManager myConfig = ConfigurationManager.getInstance();
URL url = null;
// If the string has a protocol on it, we'll assume it's an absolute
// URL. Otherwise, we'll assume it's a resource known to the
// classloader.
if (resourceName.indexOf("://") >= 0)
{
url = new URL(resourceName);
} // end if
else
{
ClassLoader cl = Thread.currentThread().getContextClassLoader();
url = cl.getResource(resourceName);
} // end else
if (url != null) {
File file = new File(url.getFile());
XMLFileHandler handler = new XMLFileHandler(file.getAbsolutePath());
myConfig.load(handler, configName);
}
}
catch (Exception e) {
e.printStackTrace();
}