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:
commit
930ebc4b31
|
@ -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)
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue