in src/main/java/org/apache/sling/jcr/contentloader/internal/BundleContentLoader.java [74:97]
public BundleContentLoader(BundleHelper bundleHelper, ContentReaderWhiteboard contentReaderWhiteboard,
BundleContentLoaderConfiguration configuration) {
super(contentReaderWhiteboard);
this.bundleHelper = bundleHelper;
this.delayedBundles = new LinkedList<>();
List<Pattern> includes = Arrays
.stream(Optional.ofNullable(configuration).map(BundleContentLoaderConfiguration::includedTargets)
.orElse(new String[0]))
.filter(Objects::nonNull).map(Pattern::compile).collect(Collectors.toList());
List<Pattern> excludes = Arrays
.stream(Optional.ofNullable(configuration).map(BundleContentLoaderConfiguration::excludedTargets)
.orElse(new String[0]))
.filter(Objects::nonNull).map(Pattern::compile).collect(Collectors.toList());
this.pathFilter = path -> {
if (configuration == null || path == null) {
return true;
} else {
return includes.stream().anyMatch(p -> p.matcher(path).matches())
&& excludes.stream().noneMatch(p -> p.matcher(path).matches());
}
};
log.debug("Using includes: {} and excludes: {}", includes, excludes);
}