lukaszlenart commented on code in PR #1365:
URL: https://github.com/apache/struts/pull/1365#discussion_r2386824856


##########
core/src/main/java/org/apache/struts2/dispatcher/multipart/JakartaMultiPartRequest.java:
##########
@@ -291,7 +291,7 @@ protected void cleanUpDiskFileItems() {
                     if (LOG.isDebugEnabled()) {
                         LOG.debug("Cleaning up disk item: {} at {}", 
normalizeSpace(item.getFieldName()), itemPath);
                     }
-                    if (!Files.deleteIfExists(itemPath)) {
+                    if (Files.exists(itemPath) && 
!Files.deleteIfExists(itemPath)) {

Review Comment:
   Thanks, you are right, added a dedicated `deleteFile()` method with handling 
IO exception



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to