当前位置: 首页>>代码示例>>Java>>正文


Java Configurations.properties方法代码示例

本文整理汇总了Java中org.apache.commons.configuration2.builder.fluent.Configurations.properties方法的典型用法代码示例。如果您正苦于以下问题:Java Configurations.properties方法的具体用法?Java Configurations.properties怎么用?Java Configurations.properties使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.apache.commons.configuration2.builder.fluent.Configurations的用法示例。


在下文中一共展示了Configurations.properties方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: get

import org.apache.commons.configuration2.builder.fluent.Configurations; //导入方法依赖的package包/类
@Override
public Configuration get() {
  Configurations configs = new Configurations();
  try {
    return configs.properties(new File(getPropertyFilePath()));
  } catch (ConfigurationException e) {
    log.error(" error on build configuration", e);
    throw new IllegalStateException(e);
  }
}
 
开发者ID:email2liyang,项目名称:grpc-mate,代码行数:11,代码来源:ConfigurationProvider.java

示例2: Config

import org.apache.commons.configuration2.builder.fluent.Configurations; //导入方法依赖的package包/类
/**
 * Read config file and store in {@code Config}.
 *
 * @param configFile the config file.
 * @throws ConfigurationException - if an error occurred when loading the configuration
 * @throws BiremeException - wrap and throw Exception which cannot be handled
 */
public Config(String configFile) throws ConfigurationException, BiremeException {
  Configurations configs = new Configurations();
  config = configs.properties(new File(configFile));

  basicConfig();
  connectionConfig("target");
  dataSourceConfig();

  logConfig();
}
 
开发者ID:HashDataInc,项目名称:bireme,代码行数:18,代码来源:Config.java

示例3: fetchTableMap

import org.apache.commons.configuration2.builder.fluent.Configurations; //导入方法依赖的package包/类
private HashMap<String, String> fetchTableMap(String dataSource)
    throws ConfigurationException, BiremeException {
  Configurations configs = new Configurations();
  Configuration tableConfig = null;

  tableConfig = configs.properties(new File(DEFAULT_TABLEMAP_DIR + dataSource + ".properties"));

  String originTable, mappedTable;
  HashMap<String, String> localTableMap = new HashMap<String, String>();
  Iterator<String> tables = tableConfig.getKeys();

  while (tables.hasNext()) {
    originTable = tables.next();
    mappedTable = tableConfig.getString(originTable);

    if (originTable.split("\\.").length != 2 || mappedTable.split("\\.").length != 2) {
      String message = "Wrong format: " + originTable + ", " + mappedTable;
      logger.fatal(message);
      throw new BiremeException(message);
    }

    localTableMap.put(dataSource + "." + originTable, mappedTable);

    if (!tableMap.values().contains(mappedTable)) {
      loadersCount++;
    }
    tableMap.put(dataSource + "." + originTable, mappedTable);
  }

  return localTableMap;
}
 
开发者ID:HashDataInc,项目名称:bireme,代码行数:32,代码来源:Config.java

示例4: Config

import org.apache.commons.configuration2.builder.fluent.Configurations; //导入方法依赖的package包/类
private Config() {
	Configuration configuration;
	try {
		Configurations configurations = new Configurations();

		configuration = configurations.properties(new File("configuration.properties"));
	} catch (ConfigurationException ce) {
		ce.printStackTrace();
		configuration = null;
	}
	this.properties = configuration;
	this.initSuccess = configuration != null;
}
 
开发者ID:PDDStudio,项目名称:phrase-java,代码行数:14,代码来源:Config.java

示例5: DoctorKafkaConfig

import org.apache.commons.configuration2.builder.fluent.Configurations; //导入方法依赖的package包/类
public DoctorKafkaConfig(String configPath) throws Exception {
  try {
    Configurations configurations = new Configurations();
    configuration = configurations.properties(new File(configPath));
    operatorConfiguration = new SubsetConfiguration(configuration, DOCTORKAFKA_PREFIX);
    this.initialize();
  } catch (Exception e) {
    LOG.error("Failed to initialize configuration file {}", configPath, e);
  }
}
 
开发者ID:pinterest,项目名称:doctorkafka,代码行数:11,代码来源:DoctorKafkaConfig.java

示例6: getDefaultConfiguration

import org.apache.commons.configuration2.builder.fluent.Configurations; //导入方法依赖的package包/类
/**
 * Loads the default properties from the classpath.
 *
 * @return the default properties
 */
private Configuration getDefaultConfiguration() {
    Configurations configs = new Configurations();
    try {
        return configs.properties(PROPERTIES_DEFAULT);
    } catch (ConfigurationException e) {
        throw new RuntimeException(String.format("Can't load default properties '%s'", PROPERTIES_DEFAULT), e);
    }
}
 
开发者ID:Swagger2Markup,项目名称:swagger2markup,代码行数:14,代码来源:Swagger2MarkupConfigBuilder.java

示例7: swagger2MarkupConfigFromCommonsConfiguration

import org.apache.commons.configuration2.builder.fluent.Configurations; //导入方法依赖的package包/类
public void swagger2MarkupConfigFromCommonsConfiguration() throws IOException, ConfigurationException {
    Path localSwaggerFile = Paths.get("/path/to/swagger.yaml");

    // tag::swagger2MarkupConfigFromCommonsConfiguration[]
    Configurations configs = new Configurations();
    Configuration configuration = configs.properties("config.properties"); //<1>

    Swagger2MarkupConfig config = new Swagger2MarkupConfigBuilder(configuration) //<2>
            .build();

    Swagger2MarkupConverter converter = Swagger2MarkupConverter.from(localSwaggerFile)
            .withConfig(config)
            .build();
    // end::swagger2MarkupConfigFromCommonsConfiguration[]
}
 
开发者ID:Swagger2Markup,项目名称:swagger2markup,代码行数:16,代码来源:DocumentationTest.java

示例8: run

import org.apache.commons.configuration2.builder.fluent.Configurations; //导入方法依赖的package包/类
public void run() {

        Swagger2MarkupConfig swagger2MarkupConfig = null;
        if(StringUtils.isNotBlank(configFile)) {
            Configurations configs = new Configurations();
            Configuration config;
            try {
                config = configs.properties(configFile);
            } catch (ConfigurationException e) {
                throw new IllegalArgumentException("Failed to read configFile", e);
            }
            swagger2MarkupConfig = new Swagger2MarkupConfigBuilder(config).build();
        }
        Swagger2MarkupConverter.Builder converterBuilder = Swagger2MarkupConverter.from(URIUtils.create(swaggerInput));
        if(swagger2MarkupConfig != null){
            converterBuilder.withConfig(swagger2MarkupConfig);
        }
        Swagger2MarkupConverter converter = converterBuilder.build();

        if(StringUtils.isNotBlank(outputFile)){
            converter.toFile(Paths.get(outputFile).toAbsolutePath());
        }else if (StringUtils.isNotBlank(outputDir)){
            converter.toFolder(Paths.get(outputDir).toAbsolutePath());
        }else {
            throw new IllegalArgumentException("Either outputFile or outputDir option must be used");
        }
    }
 
开发者ID:Swagger2Markup,项目名称:swagger2markup-cli,代码行数:28,代码来源:Application.java

示例9: ApacheCommonsConfigFile

import org.apache.commons.configuration2.builder.fluent.Configurations; //导入方法依赖的package包/类
/**
 * only used for unit testing -- loads
 * @param heapSpankPropertiesFile
 * @throws ConfigurationException
 * @throws MultiPropertyException
 */
public ApacheCommonsConfigFile(File heapSpankPropertiesFile) throws ConfigurationException, MultiPropertyException {
	
	Configurations configurations = new Configurations();
	PropertiesConfiguration config = configurations.properties(heapSpankPropertiesFile);		
			
	this.compositeConfiguration.addConfiguration( config );
	
}
 
开发者ID:eostermueller,项目名称:heapSpank,代码行数:15,代码来源:ApacheCommonsConfigFile.java


注:本文中的org.apache.commons.configuration2.builder.fluent.Configurations.properties方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。