]> source.dussan.org Git - sonarqube.git/commitdiff
Restore Api compatibility
authorDavid Gageot <david@gageot.net>
Mon, 16 Jul 2012 09:31:48 +0000 (11:31 +0200)
committerDavid Gageot <david@gageot.net>
Mon, 16 Jul 2012 09:32:26 +0000 (11:32 +0200)
sonar-batch/src/main/java/org/sonar/batch/bootstrap/ArtifactDownloader.java
sonar-plugin-api/src/main/java/org/sonar/api/utils/HttpDownloader.java

index a35feabb679776160e6942df2e6154ca3a601a9d..158dac6bbcaeb65bdc6a867d7056721a453b7fe9 100644 (file)
@@ -19,8 +19,6 @@
  */
 package org.sonar.batch.bootstrap;
 
-import com.google.common.base.Charsets;
-
 import com.google.common.collect.Lists;
 import org.apache.commons.io.FileUtils;
 import org.apache.commons.lang.CharUtils;
@@ -91,7 +89,7 @@ public class ArtifactDownloader implements BatchComponent {
     String url = baseUrl + "/deploy/plugins/index.txt";
     try {
       LOG.debug("Downloading index of plugins");
-      String indexContent = httpDownloader.downloadPlainText(new URI(url), Charsets.UTF_8);
+      String indexContent = httpDownloader.downloadPlainText(new URI(url), "UTF-8");
       String[] rows = StringUtils.split(indexContent, CharUtils.LF);
       List<RemotePlugin> remoteLocations = Lists.newArrayList();
       for (String row : rows) {
index 6a2e6332ae5e8cb9619495c9455a8b5a79815b49..f555cc7229117708b38938fd74ed8e929cc82c16 100644 (file)
@@ -152,8 +152,12 @@ public class HttpDownloader extends UriReader.SchemeProcessor implements BatchCo
     }
   }
 
-  public String downloadPlainText(URI uri, Charset charset) {
-    return readString(uri, charset);
+  public byte[] download(URI uri) {
+    return readBytes(uri);
+  }
+
+  public String downloadPlainText(URI uri, String encoding) {
+    return readString(uri, Charset.forName(encoding));
   }
 
   public void download(URI uri, File toFile) {