Skip to content

Commit

Permalink
Merge pull request kitodo#6215 from stweil/FileUtils
Browse files Browse the repository at this point in the history
Use FileUtils.deleteDirectory instead of FileSystemUtils.deleteSubDirectories
  • Loading branch information
solth authored Oct 8, 2024
2 parents ad8e816 + dd6757a commit afcb6b7
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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);
}
}

Expand Down
4 changes: 2 additions & 2 deletions Kitodo/src/test/java/org/kitodo/MockDatabase.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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);
}
}

Expand Down

0 comments on commit afcb6b7

Please sign in to comment.