From 028c83999469cc348309794aef1b2b0b2571d485 Mon Sep 17 00:00:00 2001 From: Decebal Suiu Date: Sun, 23 Jan 2022 23:41:28 +0200 Subject: [PATCH] Do nothing on delete if path not exists --- pf4j/src/main/java/org/pf4j/util/FileUtils.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/pf4j/src/main/java/org/pf4j/util/FileUtils.java b/pf4j/src/main/java/org/pf4j/util/FileUtils.java index 429f33c..2f66595 100644 --- a/pf4j/src/main/java/org/pf4j/util/FileUtils.java +++ b/pf4j/src/main/java/org/pf4j/util/FileUtils.java @@ -82,6 +82,10 @@ public final class FileUtils { * @throws IOException if something goes wrong */ public static void delete(Path path) throws IOException { + if (Files.notExists(path)) { + return; + } + Files.walkFileTree(path, new SimpleFileVisitor() { @Override -- 2.39.5