org.wso2.carbon.utils.Utils.getRuntimeConfigPath()方法的使用及代码示例

x33g5p2x  于2022-02-01 转载在 其他  
字(2.2k)|赞(0)|评价(0)|浏览(76)

本文整理了Java中org.wso2.carbon.utils.Utils.getRuntimeConfigPath()方法的一些代码示例,展示了Utils.getRuntimeConfigPath()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Utils.getRuntimeConfigPath()方法的具体详情如下:
包路径:org.wso2.carbon.utils.Utils
类名称:Utils
方法名:getRuntimeConfigPath

Utils.getRuntimeConfigPath介绍

[英]Get the conf path of the runtime.
[中]获取运行时的conf路径。

代码示例

代码示例来源:origin: org.wso2.carbon.auth/org.wso2.carbon.auth.oauth

private Map<String, List<String>> populateDefaultFileBaseScopes() {

    Map<String, List<String>> fileBasedScopeMap = new LinkedHashMap<>();
    String fileBasedConfigPath = Utils.getRuntimeConfigPath().toString() + File.separator + JDBCAuthConstants
        .FILE_BASE_SCOPE_FILE_NAME;
    try {
      String content = IOUtils.toString(new FileInputStream(fileBasedConfigPath));
      fileBasedScopeMap = (Map<String, List<String>>) new Yaml().load(content);
    } catch (IOException e) {
      log.error("Error while Reading Configuration:" + JDBCAuthConstants.FILE_BASE_SCOPE_FILE_NAME);
    }
    return fileBasedScopeMap;
  }
}

代码示例来源:origin: org.wso2.carbon.config/org.wso2.carbon.config

/**
   * Initialise carbon config provider.
   *
   * @param bundleContext OSGi Bundle Context
   */
  private void initializeConfigProvider(BundleContext bundleContext) {
    try {
      Path deploymentConfigPath = Paths.get(Utils.getRuntimeConfigPath().toString(),
          Constants.DEPLOYMENT_CONFIG_YAML);
      ConfigProvider configProvider = ConfigProviderFactory.getConfigProvider(deploymentConfigPath, secureVault);
      bundleContext.registerService(ConfigProvider.class, configProvider, null);
      logger.debug("ConfigProvider OSGi service registered successfully");
    } catch (ConfigurationException e) {
      logger.error("Error occurred while initializing config provider" , e);
    }
  }
}

代码示例来源:origin: org.wso2.carbon.secvault/org.wso2.carbon.secvault.ciphertool

System.setProperty(Constants.RUNTIME, carbonRuntime);
    Object objCipherTool = Utils.createCipherTool(urlClassLoader, org.wso2.carbon.utils.Utils
        .getRuntimeConfigPath().resolve(Constants.DEPLOYMENT_CONFIG_YAML));
    processCommand(commandName, commandParam, objCipherTool);
    if (commandLineParser.getCommandName().isPresent()) {
Path secureVaultConfigPath;
if (customConfigPath == null) {
  secureVaultConfigPath = org.wso2.carbon.utils.Utils.getRuntimeConfigPath().resolve(Constants
      .DEPLOYMENT_CONFIG_YAML);
} else {

相关文章

微信公众号

最新文章

更多