本文整理了Java中com.google.api.client.util.Base64.encodeBase64String()
方法的一些代码示例,展示了Base64.encodeBase64String()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Base64.encodeBase64String()
方法的具体详情如下:
包路径:com.google.api.client.util.Base64
类名称: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)));
内容来源于网络,如有侵权,请联系作者删除!