本文整理汇总了Java中org.apache.commons.configuration2.SystemConfiguration类的典型用法代码示例。如果您正苦于以下问题:Java SystemConfiguration类的具体用法?Java SystemConfiguration怎么用?Java SystemConfiguration使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
SystemConfiguration类属于org.apache.commons.configuration2包,在下文中一共展示了SystemConfiguration类的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: AliceRecognition
import org.apache.commons.configuration2.SystemConfiguration; //导入依赖的package包/类
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());
}
}
示例2: ConfigurationProvider
import org.apache.commons.configuration2.SystemConfiguration; //导入依赖的package包/类
public ConfigurationProvider() {
SystemConfiguration sysConfig = new SystemConfiguration();
propertyFilePath = sysConfig.getString(Constants.CONFIG_PROP_FILE_PATH, Constants.CONFIG_PROP_FILE_PATH_DEFAULT);
}
示例3: createSystem
import org.apache.commons.configuration2.SystemConfiguration; //导入依赖的package包/类
private Optional<Configuration> createSystem() {
return Optional.of(new SystemConfiguration());
}
示例4: ApacheCommonsConfigFile
import org.apache.commons.configuration2.SystemConfiguration; //导入依赖的package包/类
/**
* 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() );
}