*/
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;
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) {
}
}
- 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) {