io.fabric8.utils.Strings.replaceAllWithoutRegex()方法的使用及代码示例

x33g5p2x  于2022-01-30 转载在 其他  
字(2.3k)|赞(0)|评价(0)|浏览(94)

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

Strings.replaceAllWithoutRegex介绍

暂无

代码示例

代码示例来源:origin: fabric8io/ipaas-quickstarts

@Override
public String replace(String token) {
  return Strings.replaceAllWithoutRegex(token, pattern, "${package}");
}

代码示例来源:origin: io.fabric8/fabric8-maven-enricher-fabric8

/**
   * Replaces all text of the form <code>${foo}</code> with the value in the properties object
   */
  protected static String replaceProperties(String text, Properties properties) {
    Set<Map.Entry<Object, Object>> entries = properties.entrySet();
    for (Map.Entry<Object, Object> entry : entries) {
      Object key = entry.getKey();
      Object value = entry.getValue();
      if (key != null && value != null) {
        String pattern = "${" + key + "}";
        text = Strings.replaceAllWithoutRegex(text, pattern, value.toString());
      }
    }
    return text;
  }
}

代码示例来源:origin: io.fabric8/fabric8-devops

/**
 * If no environments have been configured lets default them from the `FABRIC8_DEFAULT_ENVIRONMENTS` environment variable
 */
public static void defaultEnvironments(ProjectConfig config, String namespace) {
  if (config != null) {
    String buildName = config.getBuildName();
    if (Strings.isNotBlank(buildName) && Maps.isNullOrEmpty(config.getEnvironments())) {
      // lets default the environments from env var
      String defaultEnvironmentsText = Systems.getEnvVarOrSystemProperty("FABRIC8_DEFAULT_ENVIRONMENTS", "Testing=${namespace}-testing,Staging=${namespace}-staging,Production=${namespace}-prod");
      String text = Strings.replaceAllWithoutRegex(defaultEnvironmentsText, "${buildName}", buildName);
      text = Strings.replaceAllWithoutRegex(text, "${namespace}", namespace);
      LinkedHashMap<String,String> environments = Maps.parseMap(text);
      config.setEnvironments(environments);
    }
  }
}

代码示例来源:origin: io.fabric8.forge/devops

LOG.warn("Cannot copy the pipeline to the project as no pipeline text could be loaded!");
} else {
  flowText = Strings.replaceAllWithoutRegex(flowText, "GIT_URL", "'" + gitUrl + "'");
  File newFile = new File(basedir, ProjectConfigs.LOCAL_FLOW_FILE_NAME);
  Files.writeToFile(newFile, flowText.getBytes());

相关文章