{
ValueParam confFile = params.getValueParam("config-file");
if (confFile != null)
{
final String path = confFile.getValue();
final ConfigParser parser = new ConfigParser();
// may work for StandaloneContainer
URL res = AccessController.doPrivileged(new PrivilegedAction<URL>()
{
public URL run()
{
return Thread.currentThread().getContextClassLoader().getResource(path);
}
});
// for PortalContainer
if (res == null)
res = configurationManager.getResource(path);
if (res == null)
throw new Exception("Resource not found " + path);
log.info("Catalog configuration found at " + res);
final URL fRes = res;
AccessController.doPrivileged(new PrivilegedExceptionAction<Void>()
{
public Void run() throws Exception
{
parser.parse(fRes);
return null;
}
});
}