protected String findFreeName(Node parentNode, String name) { if (session.hasChildNode(parentNode, name, false)) { Matcher m = dotDigitsPattern.matcher(name); if (m.matches()) { // remove trailing dot and digits name = m.group(1); } // add dot + unique digits name += "." + System.nanoTime(); } return name; }
protected boolean hasChild(Node node, String name) { return session.hasChildNode(node, name, false); }