|
|
|
@ -111,6 +111,11 @@ public class HikariConfig implements HikariConfigMBean
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
String systemProp = System.getProperty("hikaricp.configurationFile");
|
|
|
|
|
if ( systemProp != null) {
|
|
|
|
|
loadProperties(systemProp);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
@ -135,20 +140,7 @@ public class HikariConfig implements HikariConfigMBean
|
|
|
|
|
{
|
|
|
|
|
this();
|
|
|
|
|
|
|
|
|
|
final File propFile = new File(propertyFileName);
|
|
|
|
|
try (final InputStream is = propFile.isFile() ? new FileInputStream(propFile) : this.getClass().getResourceAsStream(propertyFileName)) {
|
|
|
|
|
if (is != null) {
|
|
|
|
|
Properties props = new Properties();
|
|
|
|
|
props.load(is);
|
|
|
|
|
PropertyBeanSetter.setTargetFromProperties(this, props);
|
|
|
|
|
}
|
|
|
|
|
else {
|
|
|
|
|
throw new IllegalArgumentException("Property file " + propertyFileName + " was not found.");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
catch (IOException io) {
|
|
|
|
|
throw new RuntimeException("Error loading properties file", io);
|
|
|
|
|
}
|
|
|
|
|
loadProperties(propertyFileName);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
@ -764,6 +756,24 @@ public class HikariConfig implements HikariConfigMBean
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void loadProperties(String propertyFileName)
|
|
|
|
|
{
|
|
|
|
|
final File propFile = new File(propertyFileName);
|
|
|
|
|
try (final InputStream is = propFile.isFile() ? new FileInputStream(propFile) : this.getClass().getResourceAsStream(propertyFileName)) {
|
|
|
|
|
if (is != null) {
|
|
|
|
|
Properties props = new Properties();
|
|
|
|
|
props.load(is);
|
|
|
|
|
PropertyBeanSetter.setTargetFromProperties(this, props);
|
|
|
|
|
}
|
|
|
|
|
else {
|
|
|
|
|
throw new IllegalArgumentException("Property file " + propertyFileName + " was not found.");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
catch (IOException io) {
|
|
|
|
|
throw new RuntimeException("Error loading properties file", io);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void copyState(HikariConfig other)
|
|
|
|
|
{
|
|
|
|
|
for (Field field : HikariConfig.class.getDeclaredFields()) {
|
|
|
|
|