diff --git a/accesscontroltool-bundle/src/main/java/biz/netcentric/cq/tools/actool/ui/AcToolUiService.java b/accesscontroltool-bundle/src/main/java/biz/netcentric/cq/tools/actool/ui/AcToolUiService.java
index e2d8408f..a38e907d 100644
--- a/accesscontroltool-bundle/src/main/java/biz/netcentric/cq/tools/actool/ui/AcToolUiService.java
+++ b/accesscontroltool-bundle/src/main/java/biz/netcentric/cq/tools/actool/ui/AcToolUiService.java
@@ -19,7 +19,6 @@
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
-import java.io.OutputStream;
import java.io.PrintWriter;
import java.io.StringReader;
import java.io.UncheckedIOException;
@@ -152,6 +151,8 @@ public AcToolUiService(Configuration config) {
* @throws ServletException
* @throws IOException
*/
+ @SuppressWarnings(/* SonarCloud false positive */ {
+ "javasecurity:S2083" /* resource path is not a filesystem path, https://community.sonarsource.com/t/false-positive-with-javasecurity-s2083-when-used-with-user-controlled-classloader-resource-names/187051 */})
protected void doGet(HttpServletRequest req, HttpServletResponse resp, String basePath, boolean isTouchUi)
throws ServletException, IOException {
@@ -186,7 +187,7 @@ protected void doGet(HttpServletRequest req, HttpServletResponse resp, String ba
// The following method is copied and slightly adjusted from from https://github.com/apache/felix-dev/blob/5d878f37b89ceef59920644d5e427f493b904030/webconsole/src/main/java/org/apache/felix/webconsole/servlet/AbstractServlet.java#L71
- /**
+ /**
* If the request addresses a resource , this method serves it
* and returns true. Otherwise false is returned.
*
@@ -242,14 +243,7 @@ protected final boolean spoolResource(final HttpServletRequest request, String r response.setContentLength( connection.getContentLength() ); } response.setStatus( HttpServletResponse.SC_OK); - - // spool the actual contents - final OutputStream out = response.getOutputStream(); - final byte[] buf = new byte[2048]; - int rd; - while ( ( rd = ins.read( buf ) ) >= 0 ) { - out.write( buf, 0, rd ); - } + ins.transferTo(response.getOutputStream()); } return true; } diff --git a/accesscontroltool-bundle/src/main/java/biz/netcentric/cq/tools/actool/ui/AcToolWebconsolePlugin.java b/accesscontroltool-bundle/src/main/java/biz/netcentric/cq/tools/actool/ui/AcToolWebconsolePlugin.java index e3852262..71a0c4b7 100644 --- a/accesscontroltool-bundle/src/main/java/biz/netcentric/cq/tools/actool/ui/AcToolWebconsolePlugin.java +++ b/accesscontroltool-bundle/src/main/java/biz/netcentric/cq/tools/actool/ui/AcToolWebconsolePlugin.java @@ -1,11 +1,3 @@ -/* - * (C) Copyright 2019 Netcentric, A Cognizant Digital Business. - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v2.0 - * which accompanies this distribution, and is available at - * https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.html - */ package biz.netcentric.cq.tools.actool.ui; /*-