From 19d096b3cefaba7805d98cc92e8c7dff577c5c2f Mon Sep 17 00:00:00 2001 From: Evgeny Mandrikov Date: Mon, 31 Jan 2011 13:02:48 +0300 Subject: [PATCH] Change format of response from BatchResourcesServlet --- .../org/sonar/batch/bootstrapper/BatchDownloader.java | 10 ++++++---- .../sonar/server/plugins/BatchResourcesServlet.java | 5 +++-- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/sonar-batch-bootstrapper/src/main/java/org/sonar/batch/bootstrapper/BatchDownloader.java b/sonar-batch-bootstrapper/src/main/java/org/sonar/batch/bootstrapper/BatchDownloader.java index eead8dc6d5e..27b28df1cf7 100644 --- a/sonar-batch-bootstrapper/src/main/java/org/sonar/batch/bootstrapper/BatchDownloader.java +++ b/sonar-batch-bootstrapper/src/main/java/org/sonar/batch/bootstrapper/BatchDownloader.java @@ -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; diff --git a/sonar-server/src/main/java/org/sonar/server/plugins/BatchResourcesServlet.java b/sonar-server/src/main/java/org/sonar/server/plugins/BatchResourcesServlet.java index 1e8ab666578..2a569a0d075 100644 --- a/sonar-server/src/main/java/org/sonar/server/plugins/BatchResourcesServlet.java +++ b/sonar-server/src/main/java/org/sonar/server/plugins/BatchResourcesServlet.java @@ -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); -- 2.39.5