List of usage examples for org.apache.commons.configuration.builder FileBasedConfigurationBuilder FileBasedConfigurationBuilder
public FileBasedConfigurationBuilder(Class<T> resCls)
From source file:ubic.basecode.util.ConfigUtils.java
/** * @param file/* w w w. j ava2s . com*/ * @return */ public static FileBasedConfigurationBuilder<PropertiesConfiguration> getConfigBuilder(File file) throws ConfigurationException { if (!file.exists()) { try { FileTools.touch(file); } catch (IOException e) { throw new ConfigurationException("Couldn't create the file: " + e.getMessage()); } } FileBasedConfigurationBuilder<PropertiesConfiguration> builder = new FileBasedConfigurationBuilder<PropertiesConfiguration>( PropertiesConfiguration.class); builder.configure(new FileBasedBuilderParametersImpl().setFile(file)); return builder; }