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

cziegeler pushed a commit to branch jakarta-servlet-6
in repository https://gitbox.apache.org/repos/asf/felix-dev.git


The following commit(s) were added to refs/heads/jakarta-servlet-6 by this push:
     new 4a22ee4bca Port latest webconsole changes from main branch
4a22ee4bca is described below

commit 4a22ee4bcaf71aea91f475be7a4442c8d4babbd3
Author: Carsten Ziegeler <[email protected]>
AuthorDate: Wed Aug 16 10:03:13 2023 +0200

    Port latest webconsole changes from main branch
---
 .../webconsole/internal/core/BundlesServlet.java   | 27 +++++++---------------
 1 file changed, 8 insertions(+), 19 deletions(-)

diff --git 
a/webconsole/src/main/java/org/apache/felix/webconsole/internal/core/BundlesServlet.java
 
b/webconsole/src/main/java/org/apache/felix/webconsole/internal/core/BundlesServlet.java
index 1d3360bf96..85d1089348 100755
--- 
a/webconsole/src/main/java/org/apache/felix/webconsole/internal/core/BundlesServlet.java
+++ 
b/webconsole/src/main/java/org/apache/felix/webconsole/internal/core/BundlesServlet.java
@@ -106,6 +106,8 @@ public class BundlesServlet extends SimpleWebConsolePlugin 
implements OsgiManage
 
     private static final String FIELD_BUNDLEFILE = "bundlefile";
 
+    private static final String FIELD_UPLOADID = "uploadid";
+
     // set to ask for PackageAdmin.refreshPackages() after install/update
     private static final String FIELD_REFRESH_PACKAGES = "refreshPackages";
 
@@ -363,12 +365,7 @@ public class BundlesServlet extends SimpleWebConsolePlugin 
implements OsgiManage
     throws ServletException, IOException {
         boolean success = false;
         BundleException bundleException = null;
-        final String action;
-        if (req.getParts().isEmpty()) {
-            action = req.getParameter( "action" );
-        } else {
-            action = getValue(req, "action");
-        }
+        final String action = req.getParameter( "action" );
 
         if ( "refreshPackages".equals( action ) ) {
             // refresh packages and give it most 15 seconds to finish
@@ -1477,14 +1474,6 @@ public class BundlesServlet extends 
SimpleWebConsolePlugin implements OsgiManage
 
     //---------- Bundle Installation handler (former InstallAction)
 
-    private String getValue(final HttpServletRequest request, final String 
fieldName) throws ServletException, IOException {
-        final Part part = request.getPart(fieldName);
-        if ( part != null ) {
-            return IOUtils.toString(part.getInputStream(), "UTF-8");
-        }
-        return null;
-    }
-    
     private void installBundles( final HttpServletRequest request )
     throws IOException, ServletException {
         final Collection<Part> bundleItems = request.getParts();
@@ -1493,17 +1482,17 @@ public class BundlesServlet extends 
SimpleWebConsolePlugin implements OsgiManage
         }
 
         final long uploadId;
-        final String uidVal = this.getValue(request, "uploadid");
+        final String uidVal = request.getParameter(FIELD_UPLOADID);
         if ( uidVal != null ) {
             uploadId = Long.valueOf(uidVal);
         } else {
             uploadId = -1;
         }
 
-        final String startItem = this.getValue(request, FIELD_START);
-        final String startLevelItem = this.getValue(request, FIELD_STARTLEVEL);
-        final String refreshPackagesItem = this.getValue(request, 
FIELD_REFRESH_PACKAGES);
-        final String parallelVersionItem = this.getValue(request, 
FIELD_PARALLEL_VERSION);
+        final String startItem = request.getParameter(FIELD_START);
+        final String startLevelItem = request.getParameter(FIELD_STARTLEVEL);
+        final String refreshPackagesItem = 
request.getParameter(FIELD_REFRESH_PACKAGES);
+        final String parallelVersionItem = 
request.getParameter(FIELD_PARALLEL_VERSION);
 
         // default values
         // it exists

Reply via email to