use of org.apache.commons.configuration2.builder.fluent.PropertiesBuilderParameters in project janusgraph by JanusGraph.
the class ConfigurationUtil method loadPropertiesConfig.
private static PropertiesConfiguration loadPropertiesConfig(PropertiesBuilderParameters params, boolean setCommaDelimiterHandler) throws ConfigurationException {
FileBasedConfigurationBuilder<PropertiesConfiguration> builder = new FileBasedConfigurationBuilder<PropertiesConfiguration>(PropertiesConfiguration.class);
PropertiesBuilderParameters newParams = params;
if (setCommaDelimiterHandler) {
newParams = newParams.setListDelimiterHandler(COMMA_DELIMITER_HANDLER);
}
return builder.configure(newParams).getConfiguration();
}
use of org.apache.commons.configuration2.builder.fluent.PropertiesBuilderParameters in project scheduling by ow2-proactive.
the class NodeCommandLineProperties method loadConfig.
/**
* loads NodeSource configuration.
*
* @return NodeSource configuration
*/
public static Configuration loadConfig() throws ConfigurationException {
Configuration config;
File propertiesFile = new File(NodeCommandLineProperties.class.getClassLoader().getResource(PROPERTIES_FILE).getFile());
PropertiesBuilderParameters propertyParameters = new Parameters().properties();
propertyParameters.setFile(propertiesFile);
propertyParameters.setThrowExceptionOnMissing(true);
propertyParameters.setListDelimiterHandler(DELIMITER);
FileBasedConfigurationBuilder<PropertiesConfiguration> builder = new FileBasedConfigurationBuilder<>(PropertiesConfiguration.class);
builder.configure(propertyParameters);
config = builder.getConfiguration();
LOGGER.debug("NodeSources configuration loaded");
return config;
}
Aggregations