com.linecorp.centraldogma.internal.Jackson.escapeText()方法的使用及代码示例

x33g5p2x  于2022-01-22 转载在 其他  
字(3.4k)|赞(0)|评价(0)|浏览(117)

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

Jackson.escapeText介绍

暂无

代码示例

代码示例来源:origin: line/centraldogma

"  ]," +
           "  \"username\": \"trustin\"," +
           "  \"publicKey\": \"" + Jackson.escapeText(PUBLIC_KEY) + "\"," +
           "  \"privateKey\": \"" + Jackson.escapeText(PRIVATE_KEY) + "\"," +
           "  \"passphrase\": \"" + Jackson.escapeText(PASSPHRASE) + '"' +
           '}', MirrorCredential.class))
.isEqualTo(new PublicKeyMirrorCredential(null, HOSTNAME_PATTERNS, USERNAME,
           "  ]," +
           "  \"username\": \"trustin\"," +
           "  \"publicKey\": \"" + Jackson.escapeText(PUBLIC_KEY) + "\"," +
           "  \"privateKey\": \"" + Jackson.escapeText(PRIVATE_KEY) + "\"," +
           "  \"passphrase\": \"" + Jackson.escapeText(PASSPHRASE_BASE64) + '"' +
           '}', MirrorCredential.class))
.isEqualTo(new PublicKeyMirrorCredential(null, HOSTNAME_PATTERNS, USERNAME,
           "  \"id\": \"foo\"," +
           "  \"username\": \"trustin\"," +
           "  \"publicKey\": \"" + Jackson.escapeText(PUBLIC_KEY) + "\"," +
           "  \"privateKey\": \"" + Jackson.escapeText(PRIVATE_KEY) + "\"," +
           "  \"passphrase\": \"" + Jackson.escapeText(PASSPHRASE) + '"' +
           '}', MirrorCredential.class))
.isEqualTo(new PublicKeyMirrorCredential("foo", null, USERNAME,

代码示例来源:origin: line/centraldogma

"  \"hostnamePatterns\": [ \"^.*$\" ]," +
        "  \"username\": \"" + GIT_USERNAME_HTTPS + "\"," +
        "  \"password\": \"" + Jackson.escapeText(GIT_PASSWORD) + '"' +
        '}')
});
    passphraseProperty = "\"passphrase\": \"" + Jackson.escapeText(GIT_PASSPHRASE) + '"';
  } else {
    passphraseProperty = "\"passphrase\": null";
          "  \"hostnamePatterns\": [ \"^.*$\" ]," +
          "  \"username\": \"" + GIT_USERNAME_SSH + "\"," +
          "  \"publicKey\": \"" + Jackson.escapeText(publicKey) + "\"," +
          "  \"privateKey\": \"" + Jackson.escapeText(privateKey) + "\"," +
          passphraseProperty +
          '}')

代码示例来源:origin: line/centraldogma

@Test
public void tlsConfig() throws Exception {
  final String cert = Jackson.escapeText(folder.newFile().getAbsolutePath());
  final String key = Jackson.escapeText(folder.newFile().getAbsolutePath());
  final String jsonConfig = String.format("{\"tls\": {" +
                      "\"keyCertChainFile\": \"%s\", " +
                      "\"keyFile\": \"%s\", " +
                      "\"keyPassword\": null " +
                      "}}", cert, key);
  final ParentConfig parentConfig = Jackson.readValue(jsonConfig, ParentConfig.class);
  final TlsConfig tlsConfig = parentConfig.tlsConfig;
  assertThat(tlsConfig.keyCertChainFile()).isNotNull();
  assertThat(tlsConfig.keyCertChainFile().canRead()).isTrue();
  assertThat(tlsConfig.keyFile()).isNotNull();
  assertThat(tlsConfig.keyFile().canRead()).isTrue();
  assertThat(tlsConfig.keyPassword()).isNull();
}

相关文章