X-Git-Url: https://git.argeo.org/?a=blobdiff_plain;f=org.argeo.jcr%2Fsrc%2Forg%2Fargeo%2Fjcr%2FJcr.java;h=974ee02df30e338215c202d7c0b76a0c45e3f2b3;hb=623a35d1a39522cf8b6a1d6c860ac60a2646f03d;hp=c447a17328ca49d39bfdbdc43a799d0b168d5695;hpb=10aaa7aff828d944077aa2016be1987f2ed47fa8;p=lgpl%2Fargeo-commons.git diff --git a/org.argeo.jcr/src/org/argeo/jcr/Jcr.java b/org.argeo.jcr/src/org/argeo/jcr/Jcr.java index c447a1732..974ee02df 100644 --- a/org.argeo.jcr/src/org/argeo/jcr/Jcr.java +++ b/org.argeo.jcr/src/org/argeo/jcr/Jcr.java @@ -203,6 +203,18 @@ public class Jcr { } } + /** + * @see Node#getIndex() + * @throws JcrException caused by {@link RepositoryException} + */ + public static int getIndex(Node node) { + try { + return node.getIndex(); + } catch (RepositoryException e) { + throw new JcrException("Cannot get index of " + node, e); + } + } + /** * If node has mixin {@link NodeType#MIX_TITLE}, return * {@link Property#JCR_TITLE}, otherwise return {@link #getName(Node)}.