(struts) branch feature/WW-5388-upload-servlet6 created (now 8c161f431)

2024-01-24 Thread lukaszlenart
This is an automated email from the ASF dual-hosted git repository.

lukaszlenart pushed a change to branch feature/WW-5388-upload-servlet6
in repository https://gitbox.apache.org/repos/asf/struts.git


  at 8c161f431 WW-5388 Uses the latest JakartaEE FileUpload Servlet 6 
package Also refactors the Jakarta based parsers as they have a lot in common

This branch includes the following new commits:

 new 8c161f431 WW-5388 Uses the latest JakartaEE FileUpload Servlet 6 
package Also refactors the Jakarta based parsers as they have a lot in common

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.




(struts) 01/01: WW-5388 Uses the latest JakartaEE FileUpload Servlet 6 package Also refactors the Jakarta based parsers as they have a lot in common

2024-01-24 Thread lukaszlenart
This is an automated email from the ASF dual-hosted git repository.

lukaszlenart pushed a commit to branch feature/WW-5388-upload-servlet6
in repository https://gitbox.apache.org/repos/asf/struts.git

commit 8c161f431daa7155f6f8fde1d6cb8d5ddd8785d2
Author: Lukasz Lenart 
AuthorDate: Wed Jan 24 09:09:56 2024 +0100

WW-5388 Uses the latest JakartaEE FileUpload Servlet 6 package
Also refactors the Jakarta based parsers as they have a lot in common
---
 core/pom.xml   |   4 +-
 .../multipart/AbstractMultiPartRequest.java|  12 +-
 .../multipart/JakartaMultiPartRequest.java | 189 +---
 .../multipart/JakartaStreamMultiPartRequest.java   | 321 +++--
 .../ActionFileUploadInterceptorTest.java   |  88 +++---
 .../interceptor/FileUploadInterceptorTest.java | 112 ---
 pom.xml|   4 +-
 7 files changed, 284 insertions(+), 446 deletions(-)

diff --git a/core/pom.xml b/core/pom.xml
index b4dd4b69c..9b9b94dff 100644
--- a/core/pom.xml
+++ b/core/pom.xml
@@ -216,8 +216,8 @@
 
 
 org.apache.commons
-commons-fileupload2-jakarta
-2.0.0-M1
+commons-fileupload2-jakarta-servlet6
+2.0.0-M2
 
 
 commons-io
diff --git 
a/core/src/main/java/org/apache/struts2/dispatcher/multipart/AbstractMultiPartRequest.java
 
b/core/src/main/java/org/apache/struts2/dispatcher/multipart/AbstractMultiPartRequest.java
index 256fea051..69c61d619 100644
--- 
a/core/src/main/java/org/apache/struts2/dispatcher/multipart/AbstractMultiPartRequest.java
+++ 
b/core/src/main/java/org/apache/struts2/dispatcher/multipart/AbstractMultiPartRequest.java
@@ -20,12 +20,12 @@ package org.apache.struts2.dispatcher.multipart;
 
 import com.opensymphony.xwork2.LocaleProviderFactory;
 import com.opensymphony.xwork2.inject.Inject;
+import jakarta.servlet.http.HttpServletRequest;
 import org.apache.logging.log4j.LogManager;
 import org.apache.logging.log4j.Logger;
 import org.apache.struts2.StrutsConstants;
 import org.apache.struts2.dispatcher.LocalizedMessage;
 
-import jakarta.servlet.http.HttpServletRequest;
 import java.util.ArrayList;
 import java.util.List;
 import java.util.Locale;
@@ -125,7 +125,7 @@ public abstract class AbstractMultiPartRequest implements 
MultiPartRequest {
 
 /**
  * @param request Inspect the servlet request and set the locale if one 
wasn't provided by
- * the Struts2 framework.
+ *the Struts2 framework.
  */
 protected void setLocale(HttpServletRequest request) {
 if (defaultLocale == null) {
@@ -136,7 +136,7 @@ public abstract class AbstractMultiPartRequest implements 
MultiPartRequest {
 /**
  * Build error message.
  *
- * @param e the Throwable/Exception
+ * @param ethe Throwable/Exception
  * @param args arguments
  * @return error message
  */
@@ -149,7 +149,7 @@ public abstract class AbstractMultiPartRequest implements 
MultiPartRequest {
 
 /* (non-Javadoc)
  * @see 
org.apache.struts2.dispatcher.multipart.MultiPartRequest#getErrors()
-*/
+ */
 public List getErrors() {
 return errors;
 }
@@ -171,4 +171,8 @@ public abstract class AbstractMultiPartRequest implements 
MultiPartRequest {
 return fileName;
 }
 
+protected String sanitizeNewlines(String before) {
+return before.replaceAll("[\n\r]", "_");
+}
+
 }
diff --git 
a/core/src/main/java/org/apache/struts2/dispatcher/multipart/JakartaMultiPartRequest.java
 
b/core/src/main/java/org/apache/struts2/dispatcher/multipart/JakartaMultiPartRequest.java
index ca5afd9dd..1c4d628cd 100644
--- 
a/core/src/main/java/org/apache/struts2/dispatcher/multipart/JakartaMultiPartRequest.java
+++ 
b/core/src/main/java/org/apache/struts2/dispatcher/multipart/JakartaMultiPartRequest.java
@@ -19,25 +19,23 @@
 package org.apache.struts2.dispatcher.multipart;
 
 import jakarta.servlet.http.HttpServletRequest;
+import org.apache.commons.fileupload2.core.AbstractFileUpload;
 import org.apache.commons.fileupload2.core.DiskFileItem;
 import org.apache.commons.fileupload2.core.DiskFileItemFactory;
-import org.apache.commons.fileupload2.core.FileItem;
 import org.apache.commons.fileupload2.core.FileUploadByteCountLimitException;
 import org.apache.commons.fileupload2.core.FileUploadContentTypeException;
 import org.apache.commons.fileupload2.core.FileUploadException;
 import org.apache.commons.fileupload2.core.FileUploadFileCountLimitException;
 import org.apache.commons.fileupload2.core.FileUploadSizeException;
 import org.apache.commons.fileupload2.core.RequestContext;
-import org.apache.commons.fileupload2.jakarta.JakartaServletFileUpload;
+import 
org.apache.commons.fileupload2.jakarta.servlet6.JakartaServletFileUpload;
 import org.apache.commons.lang3.StringUtils;
 import org.apache.logging.log4j.LogManager;
 import org.apa

(struts) 01/01: Stops running sonar.yml on forks

2024-01-24 Thread lukaszlenart
This is an automated email from the ASF dual-hosted git repository.

lukaszlenart pushed a commit to branch lukaszlenart-patch-1
in repository https://gitbox.apache.org/repos/asf/struts.git

commit 2513fcb292ea1fae754b9ff4d3b84ac778e9ac66
Author: Lukasz Lenart 
AuthorDate: Wed Jan 24 17:28:52 2024 +0100

Stops running sonar.yml on forks
---
 .github/workflows/sonar.yml | 1 +
 1 file changed, 1 insertion(+)

diff --git a/.github/workflows/sonar.yml b/.github/workflows/sonar.yml
index 836d50d20..4a3667e4c 100644
--- a/.github/workflows/sonar.yml
+++ b/.github/workflows/sonar.yml
@@ -31,6 +31,7 @@ jobs:
   sonarcloud:
 name: Scan
 runs-on: ubuntu-latest
+if: ${{ !github.event.pull_request.head.repo.fork }}
 steps:
   - uses: actions/checkout@v4
 with:



(struts) branch lukaszlenart-patch-1 created (now 2513fcb29)

2024-01-24 Thread lukaszlenart
This is an automated email from the ASF dual-hosted git repository.

lukaszlenart pushed a change to branch lukaszlenart-patch-1
in repository https://gitbox.apache.org/repos/asf/struts.git


  at 2513fcb29 Stops running sonar.yml on forks

This branch includes the following new commits:

 new 2513fcb29 Stops running sonar.yml on forks

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.




(struts) 01/01: Merge pull request #854 from sepe81/feature/update-security-policy

2024-01-24 Thread lukaszlenart
This is an automated email from the ASF dual-hosted git repository.

lukaszlenart pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/struts.git

commit 7843cd5e1c89d574da3162aefe28a243a6ff6345
Merge: 2de30e72a 644bd1f8c
Author: Lukasz Lenart 
AuthorDate: Wed Jan 24 17:32:44 2024 +0100

Merge pull request #854 from sepe81/feature/update-security-policy

Small spelling and MD fixes (IntelliJ assisted)

 SECURITY.md | 12 ++--
 1 file changed, 6 insertions(+), 6 deletions(-)



(struts) branch master updated (2de30e72a -> 7843cd5e1)

2024-01-24 Thread lukaszlenart
This is an automated email from the ASF dual-hosted git repository.

lukaszlenart pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/struts.git


from 2de30e72a Merge pull request #859 from apache/fix/sped-up-build
 add e7a13b963 Small spelling and MD fixes (IntelliJ assisted)
 add 644bd1f8c Mention just the maintenance branches for supported versions
 new 7843cd5e1 Merge pull request #854 from 
sepe81/feature/update-security-policy

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 SECURITY.md | 12 ++--
 1 file changed, 6 insertions(+), 6 deletions(-)



(struts) branch lukaszlenart-patch-1 deleted (was 2513fcb29)

2024-01-24 Thread lukaszlenart
This is an automated email from the ASF dual-hosted git repository.

lukaszlenart pushed a change to branch lukaszlenart-patch-1
in repository https://gitbox.apache.org/repos/asf/struts.git


 was 2513fcb29 Stops running sonar.yml on forks

The revisions that were on this branch are still contained in
other references; therefore, this change does not discard any commits
from the repository.



(struts) branch master updated (7843cd5e1 -> 5057aeac8)

2024-01-24 Thread lukaszlenart
This is an automated email from the ASF dual-hosted git repository.

lukaszlenart pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/struts.git


from 7843cd5e1 Merge pull request #854 from 
sepe81/feature/update-security-policy
 add 2513fcb29 Stops running sonar.yml on forks
 new 5057aeac8 Merge pull request #862 from apache/lukaszlenart-patch-1

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 .github/workflows/sonar.yml | 1 +
 1 file changed, 1 insertion(+)



(struts) 01/01: Merge pull request #862 from apache/lukaszlenart-patch-1

2024-01-24 Thread lukaszlenart
This is an automated email from the ASF dual-hosted git repository.

lukaszlenart pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/struts.git

commit 5057aeac8374e7143b361d05eeb600f0f622e8e9
Merge: 7843cd5e1 2513fcb29
Author: Lukasz Lenart 
AuthorDate: Wed Jan 24 18:02:22 2024 +0100

Merge pull request #862 from apache/lukaszlenart-patch-1

Stops running sonar.yml on forks

 .github/workflows/sonar.yml | 1 +
 1 file changed, 1 insertion(+)



(struts) branch feature/WW-5388-upload-servlet6 updated (8c161f431 -> b68b6ab7c)

2024-01-24 Thread lukaszlenart
This is an automated email from the ASF dual-hosted git repository.

lukaszlenart pushed a change to branch feature/WW-5388-upload-servlet6
in repository https://gitbox.apache.org/repos/asf/struts.git


from 8c161f431 WW-5388 Uses the latest JakartaEE FileUpload Servlet 6 
package Also refactors the Jakarta based parsers as they have a lot in common
 add b68b6ab7c WW-5388 Updates tests to match new logic

No new revisions were added by this update.

Summary of changes:
 .../multipart/AbstractMultiPartRequest.java|  2 +-
 .../multipart/JakartaMultiPartRequest.java |  6 ++--
 .../ActionFileUploadInterceptorTest.java   | 37 --
 .../interceptor/FileUploadInterceptorTest.java |  4 +--
 4 files changed, 20 insertions(+), 29 deletions(-)



(struts) branch feature/WW-5388-upload-servlet6 updated (b68b6ab7c -> ac9b9ad89)

2024-01-24 Thread lukaszlenart
This is an automated email from the ASF dual-hosted git repository.

lukaszlenart pushed a change to branch feature/WW-5388-upload-servlet6
in repository https://gitbox.apache.org/repos/asf/struts.git


from b68b6ab7c WW-5388 Updates tests to match new logic
 add ac9b9ad89 WW-5388 Simplifies code

No new revisions were added by this update.

Summary of changes:
 .../multipart/JakartaMultiPartRequest.java | 12 --
 .../multipart/JakartaStreamMultiPartRequest.java   | 26 +-
 2 files changed, 10 insertions(+), 28 deletions(-)



(struts) branch feature/WW-5388-upload-servlet6 updated (ac9b9ad89 -> c37a6edb6)

2024-01-24 Thread lukaszlenart
This is an automated email from the ASF dual-hosted git repository.

lukaszlenart pushed a change to branch feature/WW-5388-upload-servlet6
in repository https://gitbox.apache.org/repos/asf/struts.git


from ac9b9ad89 WW-5388 Simplifies code
 add c37a6edb6 WW-5388 Avoids unconditional invocations of method in logs

No new revisions were added by this update.

Summary of changes:
 .../struts2/dispatcher/multipart/JakartaMultiPartRequest.java  | 10 ++
 .../dispatcher/multipart/JakartaStreamMultiPartRequest.java|  8 
 2 files changed, 10 insertions(+), 8 deletions(-)