traverses incoming node trying to find primary nt:resource node

@param node
@return nt:resource node
@throws ItemNotFoundException
if no such node found
@throws RepositoryException
338499
public static Node getNtResourceRecursively(Node node) throws ItemNotFoundException, RepositoryException
   {

      if (node.isNodeType("nt:resource"))
         return node;

      Item pi = node.getPrimaryItem();
      if (pi.isNode())
      {
         return getNtResourceRecursively((Node)pi);
      }
      throw new ItemNotFoundException("No nt:resource node found for " + node.getPath());
   }
455217
def acquire_node(self, node):
        
        try:
            return node.set(self.resource, self.lock_key, nx=True, px=self.ttl)
        except (redis.exceptions.ConnectionError, redis.exceptions.TimeoutError):
            return False
544256
public static void assertPrimaryNodeType(final Node node, final String nodeType) throws RepositoryException {
        final NodeType primaryNodeType = node.getPrimaryNodeType();
        assertEquals(nodeType, primaryNodeType.getName());
    }
871872
public Optional<Tree<T>> getChild(Tree<T> node) {
    return children.stream().filter(is(node)).findFirst();
  }
1074441
private static Long getNodePropertySize(final Node node)
        throws RepositoryException {
        Long size = 0L;
        for (final PropertyIterator i = node.getProperties(); i.hasNext();) {
            final Property p = i.nextProperty();
            if (p.isMultiple()) {
                for (final Value v : p.getValues()) {
                    size += v.getBinary().getSize();
                }
            } else {
                size += p.getBinary().getSize();
            }
        }
        return size;
    }
382047
private NodeImpl getAndValidateParent(PropertyImpl property) throws Exception
   {
      NodeImpl parent = property.getParent();

      if (!parent.isNodeType("nt:resource"))
      {
         throw new Exception("Incoming node is not nt:resource type");
      }

      return parent;
   }
78757
public static Collection<RDFNode> getListItemsOrFail(RDFNode node) {

        if (!isList(node)) {
            throw new IllegalArgumentException("Resource not an rdf:List");
        }

        return getListItemsOrEmpty(node);
    }
696001
public static boolean isVersion(Node node)
   {
      try
      {
         if (node.isNodeType("nt:version"))
            return true;
         return false;
      }
      catch (RepositoryException exc)
      {
         LOG.error(exc.getMessage(), exc);
         return false;
      }
   }
147022
public ItemImpl getItem(QPath path, boolean pool) throws RepositoryException
   {
      long start = 0;
      if (LOG.isDebugEnabled())
      {
         start = System.currentTimeMillis();
         LOG.debug("getItem(" + path.getAsString() + " ) >>>>>");
      }

      ItemImpl item = null;
      try
      {
         return item = readItem(getItemData(path), pool);
      }
      finally
      {
         if (LOG.isDebugEnabled())
         {
            LOG.debug("getItem(" + path.getAsString() + ") --> " + (item != null ? item.getPath() : "null") + " <<<<< "
               + ((System.currentTimeMillis() - start) / 1000d) + "sec");
         }
      }
   }
1205782
public int removeAllChildren( Node node ) throws RepositoryException {
        isNotNull(node, "node");
        int childrenRemoved = 0;
        NodeIterator iter = node.getNodes();
        while (iter.hasNext()) {
            Node child = iter.nextNode();
            child.remove();
            ++childrenRemoved;
        }
        return childrenRemoved;
    }
205506
@Nullable
    @VisibleForTesting
    Node<V> findNode(String path, boolean exact) {
        requireNonNull(path, "path");
        return findNode(root, path, 0, exact);
    }
611811
static boolean isTryCatchNodeContainer(Node n) {
    Node parent = n.getParent();
    return parent.isTry()
        && parent.getSecondChild() == n;
  }
1097512
private static boolean isFile(Node node) throws RepositoryException
   {
      if (!node.isNodeType("nt:file"))
      {
         return false;
      }
      if (!node.getNode("jcr:content").isNodeType("nt:resource"))
      {
         return false;
      }
      return true;
   }
231761
Node getNode(Node root) {
        if (isRoot()) {
            return root;
        }

        Node startNode = root;
        Matcher pathMatcher = dotWithPreviousChar.matcher(path);
        int pos = 0;
        while (pathMatcher.find()) {
            String step = path.substring(pos, pathMatcher.end() - 1);
            pos = pathMatcher.end();
            startNode = doStep(step, startNode);
        }
        startNode = doStep(path.substring(pos), startNode);
        return startNode;
    }
822712
function findDeepestNode(node) {
	while (node.children.length) {
		node = node.children[node.children.length - 1];
	}

	return node;
}
498924
@NonNull static <E> Node<E> findLast(@NonNull Node<E> node) {
    Node<E> next;
    while ((next = node.getNextRelaxed()) != null) {
      node = next;
    }
    return node;
  }
427435
public static Node toRawNode(Node node) {
	if (node instanceof XMLStruct) return ((XMLStruct) node).toNode();
	return node;
    }