in archaius2-core/src/main/java/com/netflix/archaius/readers/PropertiesConfigReader.java [77:110]
private void internalLoad(Properties props, Set<String> seenUrls, ClassLoader loader, URL url, StrInterpolator strInterpolator, StrInterpolator.Lookup lookup) {
LOG.debug("Attempting to load : {}", url.toExternalForm());
// Guard against circular dependencies
if (!seenUrls.contains(url.toExternalForm())) {
seenUrls.add(url.toExternalForm());
try {
// Load properties into the single Properties object overriding any property
// that may already exist
Map<String, String> p = new URLConfigReader(url).call().getToAdd();
LOG.debug("Loaded : {}", url.toExternalForm());
props.putAll(p);
// Recursively load any files referenced by one of several 'include' properties
// in the file. The property value contains a list of URL's to load, where the
// last loaded file wins for any individual property collisions.
for (String nextLoadPropName : INCLUDE_KEYS) {
String nextLoadValue = (String)props.remove(nextLoadPropName);
if (nextLoadValue != null) {
for (String urlString : nextLoadValue.split(",")) {
for (URL nextUrl : getResources(loader, strInterpolator.create(lookup).resolve(urlString))) {
internalLoad(props, seenUrls, loader, nextUrl, strInterpolator, lookup);
}
}
}
}
} catch (IOException e) {
LOG.debug("Unable to load configuration file {}. {}", url, e.getMessage());
}
}
else {
LOG.debug("Circular dependency trying to load url : {}", url.toExternalForm());
}
}