Creates a new properties config given the name of a properties file. The name is expected to NOT have
the ".properties" file extension. So when new PropertiesSettings("foo") is called
this class will look in the classpath for the foo.properties file.
URL settingsUrl = ClassLoaderUtils.getResource(name + ".properties", getClass());
if (settingsUrl == null) {
LOG.debug(name + ".properties missing");
settings = new LocatableProperties();
return;
}
settings = new LocatableProperties(new LocationImpl(null, settingsUrl.toString()));
// Load settings
InputStream in = null;
try {
in = settingsUrl.openStream();
settings.load(in);
} catch (IOException e) {
throw new StrutsException("Could not load " + name + ".properties:" + e, e);
} finally {
if(in != null) {
try {
in.close();
} catch(IOException io) {
LOG.warn("Unable to close input stream", io);
}
}
}