URI btmConfig = URI.create(configArea + btmPropFile);
File cfgFile = new File(btmConfig);
if (!cfgFile.exists()) {
cfgFile = new File(btmPropFile);
if (!cfgFile.exists()) {
throw new InitializationException("Configuration file not found: " + btmPropFile);
}
}
FileReader fileReader = new FileReader(cfgFile);
Properties btmProperties = new Properties();
try {
btmProperties.load(fileReader);
}
finally {
fileReader.close();
}
System.setProperty("bitronix.tm.configuration", cfgFile.getAbsolutePath());
File resourceFile = cfgFile;
String resourcePropFile = btmProperties.getProperty("bitronix.tm.resource.configuration");
if (resourcePropFile != null) {
URI resourceConfig = URI.create(configArea + resourcePropFile);
resourceFile = new File(resourceConfig);
if (!resourceFile.exists()) {
resourceFile = new File(resourcePropFile);
if (!resourceFile.exists()) {
throw new InitializationException("Configuration file not found: " + resourcePropFile);
}
}
System.setProperty("bitronix.tm.resource.configuration", resourceFile.getAbsolutePath());
}