diff options
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, 7 insertions, 0 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 fe75a71053d..459096a3aa6 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 @@ -31,6 +31,7 @@ import org.sonar.api.CoreProperties; import org.sonar.api.utils.HttpDownloader; import org.sonar.api.utils.SonarException; import org.sonar.batch.bootstrapper.EnvironmentInformation; +import org.sonar.wsclient.SonarClient; import javax.annotation.Nullable; @@ -49,10 +50,12 @@ public class ServerClient implements BatchComponent { private BootstrapSettings settings; private HttpDownloader.BaseHttpDownloader downloader; + private SonarClient wsClient; public ServerClient(BootstrapSettings settings, EnvironmentInformation env) { this.settings = settings; this.downloader = new HttpDownloader.BaseHttpDownloader(settings.properties(), env.toString()); + this.wsClient = SonarClient.create(getURL()); } public String getURL() { @@ -93,6 +96,10 @@ public class ServerClient implements BatchComponent { } } + public SonarClient wsClient() { + return wsClient; + } + private InputSupplier<InputStream> doRequest(String pathStartingWithSlash, @Nullable Integer timeoutMillis) { Preconditions.checkArgument(pathStartingWithSlash.startsWith("/"), "Path must start with slash /"); String path = StringEscapeUtils.escapeHtml(pathStartingWithSlash); |