private static void checkDependencies(JcrNode node, List<String> paths, JcrWorkspace targetWorkspace,
Map<JcrNode, List<JcrNode>> result) {
// go through all properties
JcrPropertyIterator iterator = node.getProperties();
while (iterator.hasNext()) {
JcrProperty property = iterator.nextProperty();
// if it is a reference property
if (property.getType() == PropertyType.REFERENCE) {
// if the property has multiple values
if (property.getDefinition().isMultiple()) {
JcrValue values[] = property.getValues();
for (JcrValue value : values) {
checkReferenceValue(value, node, paths, targetWorkspace, result);
}
} else {
JcrValue value = property.getValue();
checkReferenceValue(value, node, paths, targetWorkspace, result);
}
}
}