Java 类org.apache.commons.configuration2.SystemConfiguration 实例源码

项目:carina    文件:AliceRecognition.java   
private AliceRecognition()
{
    try
    {
        CombinedConfiguration config = new CombinedConfiguration(new MergeCombiner());
        config.addConfiguration(new SystemConfiguration());
        config.addConfiguration(new FileBasedConfigurationBuilder<FileBasedConfiguration>(PropertiesConfiguration.class)
                                      .configure(new Parameters().properties().setFileName(ALICE_PROPERTIES)).getConfiguration());

        this.enabled = config.getBoolean(ALICE_ENABLED, false);
        String url = config.getString(ALICE_SERVICE_URL, null); 
        String accessToken = config.getString(ALICE_ACCESS_TOKEN, null); 
        String command = config.getString(ALICE_COMMAND, null); 

        if(enabled && !StringUtils.isEmpty(url) && !StringUtils.isEmpty(accessToken))
        {
            this.client = new AliceClient(url, command);
            this.client.setAuthToken(accessToken);
            this.enabled = this.client.isAvailable();
        }
    }
    catch (Exception e) 
    {
        LOGGER.error("Unable to initialize Alice: " + e.getMessage());
    }
}
项目:grpc-mate    文件:ConfigurationProvider.java   
public ConfigurationProvider() {
  SystemConfiguration sysConfig = new SystemConfiguration();
  propertyFilePath = sysConfig.getString(Constants.CONFIG_PROP_FILE_PATH, Constants.CONFIG_PROP_FILE_PATH_DEFAULT);
}
项目:cryptotrader    文件:ConfigurationProviderImpl.java   
private Optional<Configuration> createSystem() {
    return Optional.of(new SystemConfiguration());
}
项目:heapSpank    文件:ApacheCommonsConfigFile.java   
/**
 * This ctor supports 4 levels of configuration.
 * Levels higher in the list override levels lower in the list.
 * <ol>
 *      <li>heapSpank properties passed in as java -D parameters, aka "Java System Properties" </li>
 *      <li>heapSpank.properties file in the current folder</li>
 *      <li>heapSpank.properties file in the current user's 'home' folder.</li>
 *      <li>com.github.eostermueller.heapspank.leakyspank.console.DefaultConfig</li>
 * @throws ConfigurationException
 */
public ApacheCommonsConfigFile() throws ConfigurationException {
    this.compositeConfiguration.addConfiguration( new SystemConfiguration() );
    this.compositeConfiguration.addConfiguration( getCurrentFolderConfiguration() );
    this.compositeConfiguration.addConfiguration( getHomeFolderConfiguration() );
    this.compositeConfiguration.addConfiguration( getHeapSpankJarConfiguration() );
}