You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@sling.apache.org by dk...@apache.org on 2019/07/02 17:07:31 UTC

[sling-org-apache-sling-app-cms] 03/05: Ignoring irrelevant Sonar warnings

This is an automated email from the ASF dual-hosted git repository.

dklco pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-app-cms.git

commit 65604b7f31fdb581e6d81d2b4787d587f3c53b00
Author: Dan Klco <dk...@apache.org>
AuthorDate: Tue Jul 2 13:06:37 2019 -0400

    Ignoring irrelevant Sonar warnings
---
 .../cms/core/insights/impl/InsightsWebConsole.java |  2 +-
 .../internal/servlets/DownloadFileServlet.java     | 22 ++++++++++++++++++++++
 2 files changed, 23 insertions(+), 1 deletion(-)

diff --git a/core/src/main/java/org/apache/sling/cms/core/insights/impl/InsightsWebConsole.java b/core/src/main/java/org/apache/sling/cms/core/insights/impl/InsightsWebConsole.java
index e2895a1..26890b9 100644
--- a/core/src/main/java/org/apache/sling/cms/core/insights/impl/InsightsWebConsole.java
+++ b/core/src/main/java/org/apache/sling/cms/core/insights/impl/InsightsWebConsole.java
@@ -49,7 +49,7 @@ public class InsightsWebConsole extends AbstractWebConsolePlugin {
     public static final String CONSOLE_LABEL = "slingcms-insights";
     public static final String CONSOLE_TITLE = "Sling CMS Insights";
 
-    @SuppressWarnings("squid:S2078") // ignore since this field is is injected by OSGi
+    @SuppressWarnings({ "squid:S2078", "squid:S2226" }) // ignore since this field is is injected by OSGi
     @Reference
     private InsightFactory insightFactory;
 
diff --git a/core/src/main/java/org/apache/sling/cms/core/internal/servlets/DownloadFileServlet.java b/core/src/main/java/org/apache/sling/cms/core/internal/servlets/DownloadFileServlet.java
new file mode 100644
index 0000000..c249cc8
--- /dev/null
+++ b/core/src/main/java/org/apache/sling/cms/core/internal/servlets/DownloadFileServlet.java
@@ -0,0 +1,22 @@
+package org.apache.sling.cms.core.internal.servlets;
+
+import java.io.IOException;
+
+import javax.servlet.Servlet;
+import javax.servlet.ServletException;
+
+import org.apache.sling.api.SlingHttpServletRequest;
+import org.apache.sling.api.SlingHttpServletResponse;
+import org.apache.sling.api.servlets.SlingSafeMethodsServlet;
+import org.osgi.service.component.annotations.Component;
+
+@Component(service = Servlet.class, property = { "sling.servlet.resourceTypes=sling-cms/file/download",
+        "sling.servlet.methods=GET", "sling.servlet.extensions=html" })
+public class DownloadFileServlet extends SlingSafeMethodsServlet {
+
+    protected void doGet(SlingHttpServletRequest request, SlingHttpServletResponse response)
+            throws ServletException, IOException {
+        handleMethodNotImplemented(request, response);
+    }
+
+}