Fix two Gauava 20 deprecations across the tools package

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=146162927
This commit is contained in:
cgoldfeder 2017-01-31 14:03:46 -08:00 committed by Ben McIlwain
parent 0a2622c6ab
commit 468f1fb0f8
5 changed files with 8 additions and 8 deletions

View file

@ -148,7 +148,7 @@ class AppEngineConnection implements Connection {
}
boolean isLocalhost() {
return flags.getServer().getHostText().equals("localhost");
return flags.getServer().getHost().equals("localhost");
}
private String getUserId() {

View file

@ -43,7 +43,7 @@ class DefaultRequestFactoryModule {
@Provides
@Named("default")
public HttpRequestFactory provideHttpRequestFactory(AppEngineConnectionFlags connectionFlags) {
if (connectionFlags.getServer().getHostText().equals("localhost")) {
if (connectionFlags.getServer().getHost().equals("localhost")) {
return new NetHttpTransport()
.createRequestFactory(
new HttpRequestInitializer() {

View file

@ -50,7 +50,7 @@ final class ExecuteEppCommand extends MutatingEppToolCommand {
clientId, CharStreams.toString(new InputStreamReader(stdin, UTF_8)));
} else {
for (String command : mainParameters) {
addXmlCommand(clientId, Files.toString(new File(command), UTF_8));
addXmlCommand(clientId, Files.asCharSource(new File(command), UTF_8).read());
}
}
}

View file

@ -46,6 +46,6 @@ final class GetClaimsListCommand implements RemoteApiCommand {
public void run() throws Exception {
ClaimsListShard cl = checkNotNull(ClaimsListShard.get(), "Couldn't load ClaimsList");
String csv = Joiner.on('\n').withKeyValueSeparator(",").join(cl.getLabelsToKeys()) + "\n";
Files.write(csv, output.toFile(), UTF_8);
Files.asCharSink(output.toFile(), UTF_8).write(csv);
}
}

View file

@ -137,7 +137,7 @@ final class RegistryCli {
// RemoteApiCommands need to have the remote api installed to work.
RemoteApiInstaller installer = new RemoteApiInstaller();
RemoteApiOptions options = new RemoteApiOptions();
options.server(connection.getServer().getHostText(), connection.getServer().getPort());
options.server(connection.getServer().getHost(), connection.getServer().getPort());
if (connection.isLocalhost()) {
// Use dev credentials for localhost.
options.useDevelopmentServerCredential();