From 44216496578ca7edbb7db3b32da7eb406b4af189 Mon Sep 17 00:00:00 2001 From: Luca Burgazzoli Date: Tue, 10 Nov 2020 15:58:24 +0100 Subject: [PATCH] Error with leader election examples #548 --- .../java/org/apache/camel/k/support/RuntimeSupport.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/camel-k-core/support/src/main/java/org/apache/camel/k/support/RuntimeSupport.java b/camel-k-core/support/src/main/java/org/apache/camel/k/support/RuntimeSupport.java index 16df12d2a..782c8f5da 100644 --- a/camel-k-core/support/src/main/java/org/apache/camel/k/support/RuntimeSupport.java +++ b/camel-k-core/support/src/main/java/org/apache/camel/k/support/RuntimeSupport.java @@ -322,7 +322,7 @@ public static Map loadApplicationProperties() { try { Path confPath = Paths.get(conf); - if (Files.exists(confPath)) { + if (Files.exists(confPath) && !Files.isDirectory(confPath)) { try (Reader reader = Files.newBufferedReader(confPath)) { Properties p = new Properties(); p.load(reader); @@ -350,6 +350,10 @@ public FileVisitResult visitFile(Path file, BasicFileAttributes attrs) throws IO Objects.requireNonNull(file); Objects.requireNonNull(attrs); + if (Files.isDirectory(file)) { + return FileVisitResult.CONTINUE; + } + if (file.toFile().getAbsolutePath().endsWith(".properties")) { try (Reader reader = Files.newBufferedReader(file)) { Properties p = new Properties();