- /** Recursively outputs the contents of the given node. */
- public static void debug(Node node) throws RepositoryException {
- // First output the node path
- log.debug(node.getPath());
- // Skip the virtual (and large!) jcr:system subtree
- if (node.getName().equals("jcr:system")) {
- return;
- }
-
- // Then output the properties
- PropertyIterator properties = node.getProperties();
- while (properties.hasNext()) {
- Property property = properties.nextProperty();
- if (property.getDefinition().isMultiple()) {
- // A multi-valued property, print all values
- Value[] values = property.getValues();
- for (int i = 0; i < values.length; i++) {
- log.debug(property.getPath() + " = "
- + values[i].getString());
- }
- } else {
- // A single-valued property
- log.debug(property.getPath() + " = " + property.getString());
- }
- }
-
- }
-