From dd6757a7da22459061180843cba57c66377f5b33 Mon Sep 17 00:00:00 2001 From: Stefan Weil Date: Fri, 5 Jul 2024 22:02:13 +0200 Subject: [PATCH] Use FileUtils.deleteDirectory instead of FileSystemUtils.deleteSubDirectories Signed-off-by: Stefan Weil --- .../test/java/org/kitodo/data/elasticsearch/MockEntity.java | 4 ++-- Kitodo/src/test/java/org/kitodo/MockDatabase.java | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Kitodo-DataManagement/src/test/java/org/kitodo/data/elasticsearch/MockEntity.java b/Kitodo-DataManagement/src/test/java/org/kitodo/data/elasticsearch/MockEntity.java index 7326cbdb2a5..c59b7a1ba56 100644 --- a/Kitodo-DataManagement/src/test/java/org/kitodo/data/elasticsearch/MockEntity.java +++ b/Kitodo-DataManagement/src/test/java/org/kitodo/data/elasticsearch/MockEntity.java @@ -21,9 +21,9 @@ import java.util.function.Supplier; +import org.apache.commons.io.FileUtils; import org.awaitility.Awaitility; import org.awaitility.Durations; -import org.elasticsearch.common.io.FileSystemUtils; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.node.Node; import org.elasticsearch.transport.Netty4Plugin; @@ -54,7 +54,7 @@ public static Node prepareNode() throws Exception { private static void removeOldDataDirectories(String dataDirectory) throws Exception { File dataDir = new File(dataDirectory); if (dataDir.exists()) { - FileSystemUtils.deleteSubDirectories(dataDir.toPath()); + FileUtils.deleteDirectory(dataDir); } } diff --git a/Kitodo/src/test/java/org/kitodo/MockDatabase.java b/Kitodo/src/test/java/org/kitodo/MockDatabase.java index e5763fa0c58..e393a75098e 100644 --- a/Kitodo/src/test/java/org/kitodo/MockDatabase.java +++ b/Kitodo/src/test/java/org/kitodo/MockDatabase.java @@ -43,12 +43,12 @@ import com.xebialabs.restito.semantics.Action; import com.xebialabs.restito.server.StubServer; +import org.apache.commons.io.FileUtils; import org.apache.commons.io.IOUtils; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; import org.awaitility.Awaitility; import org.awaitility.Durations; -import org.elasticsearch.common.io.FileSystemUtils; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.node.InternalSettingsPreparer; import org.elasticsearch.node.Node; @@ -293,7 +293,7 @@ private static String readMapping(String mappingType) { private static void removeOldDataDirectories(String dataDirectory) throws Exception { File dataDir = new File(dataDirectory); if (dataDir.exists()) { - FileSystemUtils.deleteSubDirectories(dataDir.toPath()); + FileUtils.deleteDirectory(dataDir); } }