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

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

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

Files.writeToFile介绍

[英]Writes String content to File.
[中]将字符串内容写入文件。

代码示例

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

protected File createSshKeyFile(String namespace, String sourceSecretName, String privateKeyName, String privateKey) throws IOException {
  File keyFile = null;
  if (privateKey != null) {
    String text = Base64Encoder.decode(privateKey);
    keyFile = projectFileSystem.getSecretsFolder(namespace, sourceSecretName, privateKeyName);
    Files.writeToFile(keyFile, text.getBytes());
  }
  return keyFile;
}

代码示例来源:origin: io.jenkins.updatebot/updatebot-core

Files.writeToFile(file, updatedText, StandardCharsets.UTF_8);

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

protected CommitInfo doWrite(Git git, String path, byte[] contents, PersonIdent personIdent, String commitMessage) throws Exception {
  File file = getRelativeFile(path);
  file.getParentFile().mkdirs();
  Files.writeToFile(file, contents);
  String filePattern = getFilePattern(path);
  AddCommand add = git.add().addFilepattern(filePattern).addFilepattern(".");
  add.call();
  CommitCommand commit = git.commit().setAll(true).setAuthor(personIdent).setMessage(commitMessage);
  RevCommit revCommit = commitThenPush(git, commit);
  return createCommitInfo(revCommit);
}

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

flowText = Strings.replaceAllWithoutRegex(flowText, "GIT_URL", "'" + gitUrl + "'");
File newFile = new File(basedir, ProjectConfigs.LOCAL_FLOW_FILE_NAME);
Files.writeToFile(newFile, flowText.getBytes());
LOG.info("Written pipeline to " + newFile);
config.setPipeline(null);

相关文章