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

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


The following commit(s) were added to refs/heads/master by this push:
     new 2fcbb9b5eb FELIX-6595 : Update to Commons Fileupload 1.5
2fcbb9b5eb is described below

commit 2fcbb9b5ebc0c52d2188c363dce25ccbc606ffb5
Author: Carsten Ziegeler <[email protected]>
AuthorDate: Tue Feb 21 10:33:19 2023 +0100

    FELIX-6595 : Update to Commons Fileupload 1.5
---
 .../main/java/org/apache/felix/webconsole/WebConsoleUtil.java | 11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)

diff --git 
a/webconsole/src/main/java/org/apache/felix/webconsole/WebConsoleUtil.java 
b/webconsole/src/main/java/org/apache/felix/webconsole/WebConsoleUtil.java
index bd2320aeac..ca8fbec9a6 100644
--- a/webconsole/src/main/java/org/apache/felix/webconsole/WebConsoleUtil.java
+++ b/webconsole/src/main/java/org/apache/felix/webconsole/WebConsoleUtil.java
@@ -130,7 +130,7 @@ public final class WebConsoleUtil
         }
 
         // check, whether we already have the parameters
-        Map params = ( Map ) request.getAttribute( 
AbstractWebConsolePlugin.ATTR_FILEUPLOAD );
+        Map<String, FileItem[]> params = ( Map<String, FileItem[]> ) 
request.getAttribute( AbstractWebConsolePlugin.ATTR_FILEUPLOAD );
         if ( params == null )
         {
             // parameters not read yet, read now
@@ -147,15 +147,16 @@ public final class WebConsoleUtil
             // Create a new file upload handler
             ServletFileUpload upload = new ServletFileUpload( factory );
             upload.setSizeMax( -1 );
+            upload.setFileCountMax(50);
 
             // Parse the request
-            params = new HashMap();
+            params = new HashMap<>();
             try
             {
-                List items = upload.parseRequest( request );
-                for ( Iterator fiter = items.iterator(); fiter.hasNext(); )
+                final List<FileItem> items = upload.parseRequest( request );
+                for ( final Iterator<FileItem> fiter = items.iterator(); 
fiter.hasNext(); )
                 {
-                    FileItem fi = ( FileItem ) fiter.next();
+                    final FileItem fi = fiter.next();
                     FileItem[] current = ( FileItem[] ) params.get( 
fi.getFieldName() );
                     if ( current == null )
                     {

Reply via email to