/** * Determine and return the first of any nodes in the shared set exist at a location that is at or below the supplied * path. * * @param path the path; may not be null * @return the node in the shared set that exists at or below the supplied path; or null if none of the nodes in the * shared set are at or below the supplied path * @throws ItemNotFoundException * @throws InvalidItemStateException * @throws RepositoryException */ public AbstractJcrNode getSharedNodeAtOrBelow( Path path ) throws RepositoryException, ItemNotFoundException, InvalidItemStateException { NodeIterator iter = getSharedNodes(); while (iter.hasNext()) { AbstractJcrNode shared = (AbstractJcrNode)iter.nextNode(); if (shared.path().isAtOrBelow(path)) return shared; } return null; }
/** * Determine and return the first of any nodes in the shared set exist at a location that is at or below the supplied * path. * * @param path the path; may not be null * @return the node in the shared set that exists at or below the supplied path; or null if none of the nodes in the * shared set are at or below the supplied path * @throws ItemNotFoundException * @throws InvalidItemStateException * @throws RepositoryException */ public AbstractJcrNode getSharedNodeAtOrBelow( Path path ) throws RepositoryException, ItemNotFoundException, InvalidItemStateException { NodeIterator iter = getSharedNodes(); while (iter.hasNext()) { AbstractJcrNode shared = (AbstractJcrNode)iter.nextNode(); if (shared.path().isAtOrBelow(path)) return shared; } return null; }
if (sharedSet.getSize() != 1) { NodeIterator sharedSetNodes = sharedSet.getSharedNodes(); List<AbstractJcrNode> shared = new ArrayList<AbstractJcrNode>(); while (sharedSetNodes.hasNext()) {
if (sharedSet.getSize() != 1) { NodeIterator sharedSetNodes = sharedSet.getSharedNodes(); List<AbstractJcrNode> shared = new ArrayList<AbstractJcrNode>(); while (sharedSetNodes.hasNext()) {
@Override public NodeIterator getSharedSet() throws RepositoryException { if (isShareable()) { // Find the nodes that make up this shared set ... return sharedSet().getSharedNodes(); } // Otherwise, the shared set is just this node ... return new JcrSingleNodeIterator(this); }
@Override public NodeIterator getSharedSet() throws RepositoryException { if (isShareable()) { // Find the nodes that make up this shared set ... return sharedSet().getSharedNodes(); } // Otherwise, the shared set is just this node ... return new JcrSingleNodeIterator(this); }