Narrow criteria for hidden property paths

A previous change intended to prevent temporary directories created as
an implementation detail of mounting volumes on kubernetes pods from
being used as a source for property files had a side-effect of also
preventing other types of hidden directories from being recognized. This
commit narrows the criteria for considering a directory as hidden,
using the kubernetes `..` prefix convention instead of the Unix `.`
prefix.

Fixes gh-23983
pull/24095/head
Scott Frederick 4 years ago
parent fdd028d52c
commit 62aa1b7aaf

@ -569,7 +569,7 @@ public class ConfigFileApplicationListener implements EnvironmentPostProcessor,
private boolean hasHiddenPathElement(Resource resource) throws IOException {
String cleanPath = StringUtils.cleanPath(resource.getFile().getAbsolutePath());
for (Path value : Paths.get(cleanPath)) {
if (value.toString().startsWith(".")) {
if (value.toString().startsWith("..")) {
return true;
}
}

Loading…
Cancel
Save