diff options
author | Simon Brandhof <simon.brandhof@gmail.com> | 2012-10-27 09:28:05 +0200 |
---|---|---|
committer | Simon Brandhof <simon.brandhof@gmail.com> | 2012-10-27 09:28:05 +0200 |
commit | 73ae841b1d90ca0d51fc2d27ec3f9b235c75dd61 (patch) | |
tree | ac8bf4b2bedeb22a4e6fb2dcc5fee1ede65d0b4e /sonar-batch/src/main/java/org/sonar/batch/bootstrap/ServerClient.java | |
parent | b37cc878ad2e5952807aef46e966f7d790f52a2d (diff) | |
download | sonarqube-73ae841b1d90ca0d51fc2d27ec3f9b235c75dd61.tar.gz sonarqube-73ae841b1d90ca0d51fc2d27ec3f9b235c75dd61.zip |
Fix backward compatibility with org.sonar.batch.ServerMetadata
Diffstat (limited to 'sonar-batch/src/main/java/org/sonar/batch/bootstrap/ServerClient.java')
-rw-r--r-- | sonar-batch/src/main/java/org/sonar/batch/bootstrap/ServerClient.java | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/sonar-batch/src/main/java/org/sonar/batch/bootstrap/ServerClient.java b/sonar-batch/src/main/java/org/sonar/batch/bootstrap/ServerClient.java index 2634faec1ef..7b643b2c541 100644 --- a/sonar-batch/src/main/java/org/sonar/batch/bootstrap/ServerClient.java +++ b/sonar-batch/src/main/java/org/sonar/batch/bootstrap/ServerClient.java @@ -48,11 +48,11 @@ import java.util.Date; */ public class ServerClient extends Server implements BatchComponent { private Settings settings; - private EnvironmentInformation env; + private HttpDownloader.BaseHttpDownloader downloader; public ServerClient(Settings settings, EnvironmentInformation env) { this.settings = settings; - this.env = env; + this.downloader = new HttpDownloader.BaseHttpDownloader(settings, env.toString()); } @Override @@ -89,7 +89,7 @@ public class ServerClient extends Server implements BatchComponent { return settings.getString(CoreProperties.PERMANENT_SERVER_ID); } - public String getServerId() throws IOException { + public String getServerId() { String remoteServerInfo = request("/api/server"); // don't use JSON utilities to extract ID from such a small string return extractServerId(remoteServerInfo); @@ -126,7 +126,6 @@ public class ServerClient extends Server implements BatchComponent { String login = settings.getString(CoreProperties.LOGIN); try { - HttpDownloader.BaseHttpDownloader downloader = new HttpDownloader.BaseHttpDownloader(settings, env.toString()); InputSupplier<InputStream> inputSupplier; if (Strings.isNullOrEmpty(login)) { inputSupplier = downloader.newInputSupplier(uri); |