in src/main/java/org/apache/sling/clam/jcr/internal/DefaultNodeDescendingJcrPropertyDigger.java [83:117]
private void digWithAbsoluteMaxDepth(@NotNull final Node node, @NotNull final Pattern pattern, @NotNull final Set<Integer> propertyTypes, final long maxLength, final int absoluteMaxDepth) throws Exception {
logger.debug("digging node: {}", node.getPath());
final PropertyIterator properties = node.getProperties();
while (properties.hasNext()) {
final Property property = properties.nextProperty();
final int propertyType = property.getType();
final String path = property.getPath();
logger.debug("digging property: {}", path);
if (propertyTypes.contains(propertyType) && pattern.matcher(path).matches()) {
if (property.isMultiple()) { // multiple property values
final long[] lengths = property.getLengths();
for (int index = 0; index < lengths.length; index++) {
final long length = lengths[index];
if (checkLength(length, maxLength)) {
jobManager.addJob(scanJobTopic(propertyType), properties(path, index, null));
} else {
logger.warn("Length of property '{}' [{}] greater than given max length ({}).", path, index, maxLength);
}
}
} else { // single property value
if (checkLength(property.getLength(), maxLength)) {
jobManager.addJob(scanJobTopic(propertyType), properties(path, null));
} else {
logger.warn("Length of property '{}' greater than given max length ({}).", path, maxLength);
}
}
}
}
if (absoluteMaxDepth == -1 || node.getDepth() < absoluteMaxDepth) {
final NodeIterator nodes = node.getNodes();
while (nodes.hasNext()) {
digWithAbsoluteMaxDepth(nodes.nextNode(), pattern, propertyTypes, maxLength, absoluteMaxDepth);
}
}
}