Skip to content

Commit

Permalink
Merge pull request #11945 from jetty/fix/12.0.x/multipart-part-delete…
Browse files Browse the repository at this point in the history
…-existence-check

Issue #11944 - Part.delete() should only attempt to delete if the file exists
  • Loading branch information
joakime authored Jun 24, 2024
2 parents 865b726 + 82faaee commit 930ebc4
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -306,7 +306,7 @@ public void delete() throws IOException
Path path = getPath();
if (path != null)
{
Files.delete(path);
Files.deleteIfExists(path);
try (AutoLock ignored = lock.lock())
{
this.path = null;
Expand Down Expand Up @@ -338,7 +338,7 @@ public void fail(Throwable t)
if (source != null)
source.fail(t);
if (path != null)
Files.delete(path);
Files.deleteIfExists(path);
}
catch (Throwable x)
{
Expand Down

0 comments on commit 930ebc4

Please sign in to comment.