From: Decebal Suiu Date: Sun, 23 Jan 2022 21:41:28 +0000 (+0200) Subject: Do nothing on delete if path not exists X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=028c83999469cc348309794aef1b2b0b2571d485;p=pf4j.git Do nothing on delete if path not exists --- 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