github-code-scanning[bot] commented on code in PR #4:
URL: 
https://github.com/apache/sling-org-apache-sling-tooling-support-install/pull/4#discussion_r1020767045


##########
src/main/java/org/apache/sling/tooling/support/install/impl/InstallServlet.java:
##########
@@ -96,77 +94,67 @@
             result.render(resp.getWriter());
             return;
         }
-
         if (isMultipart) {
-            installBasedOnUploadedJar(req, resp);
+            installBundleFromJar(req, resp, refreshPackages);
         } else {
-            installBasedOnDirectory(resp, new File(dirPath));
+            installBundleFromDirectory(resp, Paths.get(dirPath), 
refreshPackages);

Review Comment:
   ## Exceptions should not be thrown from servlet methods
   
   <!--SONAR_ISSUE_KEY:AYRsOqoHkHWZEk4hmwoR-->Handle the following exception 
that could be thrown by "installBundleFromDirectory": IOException. <p>See more 
on <a 
href="https://sonarcloud.io/project/issues?id=apache_sling-org-apache-sling-tooling-support-install&issues=AYRsOqoHkHWZEk4hmwoR&open=AYRsOqoHkHWZEk4hmwoR&pullRequest=4";>SonarCloud</a></p>
   
   [Show more 
details](https://github.com/apache/sling-org-apache-sling-tooling-support-install/security/code-scanning/14)



##########
src/main/java/org/apache/sling/tooling/support/install/impl/InstallServlet.java:
##########
@@ -96,77 +94,67 @@
             result.render(resp.getWriter());
             return;
         }
-
         if (isMultipart) {
-            installBasedOnUploadedJar(req, resp);
+            installBundleFromJar(req, resp, refreshPackages);

Review Comment:
   ## Exceptions should not be thrown from servlet methods
   
   <!--SONAR_ISSUE_KEY:AYRsOqoHkHWZEk4hmwoQ-->Handle the following exceptions 
that could be thrown by "installBundleFromJar": IOException, ServletException. 
<p>See more on <a 
href="https://sonarcloud.io/project/issues?id=apache_sling-org-apache-sling-tooling-support-install&issues=AYRsOqoHkHWZEk4hmwoQ&open=AYRsOqoHkHWZEk4hmwoQ&pullRequest=4";>SonarCloud</a></p>
   
   [Show more 
details](https://github.com/apache/sling-org-apache-sling-tooling-support-install/security/code-scanning/15)



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscr...@sling.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to