You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@kie.apache.org by kb...@apache.org on 2023/11/13 08:32:47 UTC
(incubator-kie-kogito-benchmarks) 20/38: Skip cleaning of non-existing directories and files
This is an automated email from the ASF dual-hosted git repository.
kbowers pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/incubator-kie-kogito-benchmarks.git
commit 85ac16d1abdc982c1bf12c1205ece1882b665dd5
Author: Marián Macik <mm...@redhat.com>
AuthorDate: Fri Jun 11 14:00:48 2021 +0200
Skip cleaning of non-existing directories and files
---
.../src/main/java/org/kie/kogito/benchmarks/framework/Commands.java | 3 +++
1 file changed, 3 insertions(+)
diff --git a/kogito-benchmarks-framework/src/main/java/org/kie/kogito/benchmarks/framework/Commands.java b/kogito-benchmarks-framework/src/main/java/org/kie/kogito/benchmarks/framework/Commands.java
index 45b30bf..b2966d5 100644
--- a/kogito-benchmarks-framework/src/main/java/org/kie/kogito/benchmarks/framework/Commands.java
+++ b/kogito-benchmarks-framework/src/main/java/org/kie/kogito/benchmarks/framework/Commands.java
@@ -25,6 +25,7 @@ import java.net.Socket;
import java.net.UnknownHostException;
import java.nio.charset.StandardCharsets;
import java.nio.file.Files;
+import java.nio.file.NoSuchFileException;
import java.nio.file.Path;
import java.util.ArrayList;
import java.util.Arrays;
@@ -234,6 +235,8 @@ public class Commands {
.sorted(Comparator.reverseOrder())
.map(Path::toFile)
.forEach(File::delete);
+ } catch (NoSuchFileException e) {
+ logger.info("Cleaning of directory {} skipped because it does not exist.", e.getFile());
} catch (IOException e) {
throw new RuntimeException("Unable to delete directories or files", e);
}
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org
For additional commands, e-mail: commits-help@kie.apache.org