in org.apache.sling.ddr/core/src/main/java/org/apache/sling/ddr/core/DeclarativeDynamicResourceProviderHandler.java [272:300]
boolean filterSource(Resource source) {
if(allowedDDRFilter.isEmpty() && prohibitedDDRFilter.isEmpty()) { return true; }
if(source == null) { return false; }
ValueMap properties = source.getValueMap();
if(!allowedDDRFilter.isEmpty()) {
boolean found = allowedDDRFilter.isEmpty();
for (Entry<String, List<String>> filter : allowedDDRFilter.entrySet()) {
String propertyValue = properties.get(filter.getKey(), String.class);
if (propertyValue != null) {
if (!filter.getValue().contains(propertyValue)) {
found = true;
break;
}
}
}
if(!found) {
return false;
}
}
for(Entry<String,List<String>> filter: prohibitedDDRFilter.entrySet()) {
String propertyValue = properties.get(filter.getKey(), String.class);
if(propertyValue != null) {
if(filter.getValue().contains(propertyValue)) {
return false;
}
}
}
return true;
}