Merge pull request #11945 from jetty/fix/12.0.x/multipart-part-delete-existence-check

Issue #11944 - Part.delete() should only attempt to delete if the file exists
This commit is contained in:
Joakim Erdfelt 2024-06-24 07:23:48 -05:00 committed by GitHub
commit 930ebc4b31
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 2 additions and 2 deletions

View File

@ -306,7 +306,7 @@ public class MultiPart
Path path = getPath();
if (path != null)
{
Files.delete(path);
Files.deleteIfExists(path);
try (AutoLock ignored = lock.lock())
{
this.path = null;
@ -338,7 +338,7 @@ public class MultiPart
if (source != null)
source.fail(t);
if (path != null)
Files.delete(path);
Files.deleteIfExists(path);
}
catch (Throwable x)
{