From 505340909a278caa0cf3e82a7177faf2f123c805 Mon Sep 17 00:00:00 2001 From: Scott Frederick Date: Tue, 5 Jan 2021 14:04:59 -0600 Subject: [PATCH] Support symlinks in configtree property paths Prior to this commit, the configtree property source would not traverse into a sub-directory in a property path if the sub-directory was a symbolic link. This commit allows symlinked sub-directories to be traversed like any other sub-directory in the property path. Fixes gh-24530 --- .../boot/env/ConfigTreePropertySource.java | 20 ++++++++++--------- .../env/ConfigTreePropertySourceTests.java | 9 +++++++++ 2 files changed, 20 insertions(+), 9 deletions(-) diff --git a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/env/ConfigTreePropertySource.java b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/env/ConfigTreePropertySource.java index fd71316ee39..0f2491b9798 100644 --- a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/env/ConfigTreePropertySource.java +++ b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/env/ConfigTreePropertySource.java @@ -19,6 +19,7 @@ package org.springframework.boot.env; import java.io.ByteArrayInputStream; import java.io.IOException; import java.io.InputStream; +import java.nio.file.FileVisitOption; import java.nio.file.Files; import java.nio.file.Path; import java.nio.file.attribute.BasicFileAttributes; @@ -203,15 +204,16 @@ public class ConfigTreePropertySource extends EnumerablePropertySource imp static Map findAll(Path sourceDirectory, Set