Пример #1
0
 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;
 }
Пример #2
0
 protected boolean hasChild(Node node, String name) {
   return session.hasChildNode(node, name, false);
 }