Merge pull request #10 from swaldman/master

Added a constructor for HikariConfig that accepts a Properties object. M...
pull/12/merge
brettwooldridge 11 years ago
commit 506b1df5fa

@ -81,6 +81,18 @@ public final class HikariConfig implements HikariConfigMBean
poolName = "HikariPool-" + poolNumber++;
}
/**
* Construct a HikariConfig from the specified properties object.
*
* @param properties the name of the property file
*/
public HikariConfig(Properties properties)
{
this();
PropertyBeanSetter.setTargetFromProperties(this, properties);
}
/**
* Construct a HikariConfig from the specified property file name.
*
@ -96,9 +108,8 @@ public final class HikariConfig implements HikariConfigMBean
throw new IllegalArgumentException("Property file " + propertyFileName + " was not found.");
}
try
try ( FileInputStream fis = new FileInputStream(propFile) )
{
FileInputStream fis = new FileInputStream(propFile);
Properties props = new Properties();
props.load(fis);
PropertyBeanSetter.setTargetFromProperties(this, props);

Loading…
Cancel
Save