From 98c8b7c4d927b20f83b11234ce3b57ea7424830f Mon Sep 17 00:00:00 2001 From: jstastny-cz Date: Tue, 12 Mar 2024 10:56:05 +0100 Subject: [PATCH] incubator-kie-kogito-runtimes#3438: check if resources folder path exists --- .../deployment/KogitoAddOnSourceFilesProcessor.java | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/quarkus/addons/source-files/deployment/src/main/java/org/kie/kogito/addon/source/files/deployment/KogitoAddOnSourceFilesProcessor.java b/quarkus/addons/source-files/deployment/src/main/java/org/kie/kogito/addon/source/files/deployment/KogitoAddOnSourceFilesProcessor.java index e3641df6ae1..8ab5587f562 100644 --- a/quarkus/addons/source-files/deployment/src/main/java/org/kie/kogito/addon/source/files/deployment/KogitoAddOnSourceFilesProcessor.java +++ b/quarkus/addons/source-files/deployment/src/main/java/org/kie/kogito/addon/source/files/deployment/KogitoAddOnSourceFilesProcessor.java @@ -87,11 +87,13 @@ private List getSourceFiles(File[] resourcePaths) throws IOException { for (File resourceFile : resourcePaths) { Path resourcePath = resourceFile.toPath(); - try (Stream walkedPaths = Files.walk(resourcePath)) { - walkedPaths.filter(this::isSourceFile) - .map(resourcePath::relativize) - .map(Path::toString) - .forEach(sourceFiles::add); + if (Files.exists(resourcePath)) { + try (Stream walkedPaths = Files.walk(resourcePath)) { + walkedPaths.filter(this::isSourceFile) + .map(resourcePath::relativize) + .map(Path::toString) + .forEach(sourceFiles::add); + } } }