Skip to content

Commit

Permalink
Error with leader election examples #548
Browse files Browse the repository at this point in the history
  • Loading branch information
lburgazzoli committed Nov 10, 2020
1 parent 87c03f6 commit 4421649
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -322,7 +322,7 @@ public static Map<String, String> 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);
Expand Down Expand Up @@ -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();
Expand Down

0 comments on commit 4421649

Please sign in to comment.