com.google.api.client.util.Base64.encodeBase64String()方法的使用及代码示例

x33g5p2x  于2022-01-16 转载在 其他  
字(2.7k)|赞(0)|评价(0)|浏览(189)

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

Base64.encodeBase64String介绍

暂无

代码示例

代码示例来源:origin: GoogleContainerTools/jib

/**
 * @param username the username
 * @param secret the secret
 * @return an {@link Authorization} with a {@code Basic} credentials
 */
public static Authorization withBasicCredentials(String username, String secret) {
 String credentials = username + ":" + secret;
 String token = Base64.encodeBase64String(credentials.getBytes(StandardCharsets.UTF_8));
 return new Authorization("Basic", token);
}

代码示例来源:origin: com.google.enterprise.cloudsearch/google-cloudsearch-connector-sdk

/** Optional. Specifies a user name and password for proxy authentication. */
public Builder setUserNamePassword(String userName, String password) {
 this.authToken =
   Base64.encodeBase64String(String.format("%s:%s", userName, password).getBytes());
 return this;
}

代码示例来源:origin: gradle.plugin.com.google.cloud.tools/jib-gradle-plugin

/**
 * @param username the username
 * @param secret the secret
 * @return an {@link Authorization} with a {@code Basic} credentials
 */
public static Authorization withBasicCredentials(String username, String secret) {
 String credentials = username + ":" + secret;
 String token = Base64.encodeBase64String(credentials.getBytes(StandardCharsets.UTF_8));
 return new Authorization("Basic", token);
}

代码示例来源:origin: com.google.cloud.tools/jib-maven-plugin

/**
 * @param username the username
 * @param secret the secret
 * @return an {@link Authorization} with a {@code Basic} credentials
 */
public static Authorization withBasicCredentials(String username, String secret) {
 String credentials = username + ":" + secret;
 String token = Base64.encodeBase64String(credentials.getBytes(StandardCharsets.UTF_8));
 return new Authorization("Basic", token);
}

代码示例来源:origin: org.apache.beam/beam-sdks-java-io-google-cloud-platform

static String encodeQuery(List<TableRow> rows) throws IOException {
 ListCoder<TableRow> listCoder = ListCoder.of(TableRowJsonCoder.of());
 ByteArrayOutputStream output = new ByteArrayOutputStream();
 listCoder.encode(rows, output, Context.OUTER);
 return Base64.encodeBase64String(output.toByteArray());
}

代码示例来源:origin: org.apache.beam/beam-runners-google-cloud-dataflow-java

cloudSource.getSpec(), SERIALIZED_SOURCE, encodeBase64String(serializeToByteArray(source)));
  getDesiredNumUnboundedSourceSplits(options.as(DataflowPipelineOptions.class));
for (UnboundedSource<?, ?> split : unboundedSource.split(desiredNumSplits, options)) {
 encodedSplits.add(encodeBase64String(serializeToByteArray(split)));

相关文章