From dba1916de78436d7b1aa880304bfff8dde4b8670 Mon Sep 17 00:00:00 2001 From: Marc Baloup Date: Sun, 2 Feb 2020 16:37:06 +0100 Subject: [PATCH] Add DirUtils --- src/main/java/fr/pandacube/util/DirUtils.java | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 src/main/java/fr/pandacube/util/DirUtils.java diff --git a/src/main/java/fr/pandacube/util/DirUtils.java b/src/main/java/fr/pandacube/util/DirUtils.java new file mode 100644 index 0000000..a1d378b --- /dev/null +++ b/src/main/java/fr/pandacube/util/DirUtils.java @@ -0,0 +1,13 @@ +package fr.pandacube.util; + +import java.io.File; + +public class DirUtils { + public static void delete(final File target) { + if (target.isDirectory()) + for (final File child : target.listFiles()) + delete(child); + + target.delete(); + } +}