]> source.dussan.org Git - sonarqube.git/commitdiff
Change format of response from BatchResourcesServlet
authorEvgeny Mandrikov <mandrikov@gmail.com>
Mon, 31 Jan 2011 10:02:48 +0000 (13:02 +0300)
committerEvgeny Mandrikov <mandrikov@gmail.com>
Mon, 31 Jan 2011 10:03:30 +0000 (13:03 +0300)
sonar-batch-bootstrapper/src/main/java/org/sonar/batch/bootstrapper/BatchDownloader.java
sonar-server/src/main/java/org/sonar/server/plugins/BatchResourcesServlet.java

index eead8dc6d5e5edb5450f6680b89a89efb1422410..27b28df1cf7ba74da85d407e60aa69713a7179e4 100644 (file)
@@ -76,10 +76,12 @@ public class BatchDownloader {
 
       String libs = remoteContent(BATCH_PATH);
 
-      for (String lib : libs.split(",")) {
-        File file = new File(toDir, lib);
-        remoteContentToFile(BATCH_PATH + lib, file);
-        files.add(file);
+      for (String lib : libs.split("\n")) {
+        if ("".equals(lib)) {
+          File file = new File(toDir, lib);
+          remoteContentToFile(BATCH_PATH + lib, file);
+          files.add(file);
+        }
       }
 
       return files;
index 1e8ab66657800fe16e33f4a1c913e231261bdd64..2a569a0d075d9a257fd092665af9bf3863e97568 100644 (file)
@@ -51,10 +51,11 @@ public class BatchResourcesServlet extends HttpServlet {
     if (StringUtils.isEmpty(resource)) {
       PrintWriter writer = null;
       try {
-        String libs = StringUtils.join(getLibs(), ",");
         response.setContentType("text/html");
         writer = response.getWriter();
-        writer.println(libs);
+        for (String lib : getLibs()) {
+          writer.println(lib);
+        }
       } catch (IOException e) {
         LOG.error("Unable to provide list of batch resources", e);
         response.sendError(HttpServletResponse.SC_INTERNAL_SERVER_ERROR);