Package javax.jcr

Examples of javax.jcr.NodeIterator.nextNode()


        while (nodeItr.hasNext()) {
            if (nodeItr.getSize() > 1) {
                throw new RepositoryException(
                    "more than one node found for pattern: " + startPattern);
            }
            chunkNode = nodeItr.nextNode();

            String[] indexBounds = chunkNode.getName().substring(
                (SlingPostConstants.CHUNK_NODE_NAME + "_").length()).split("_");
            startPattern = SlingPostConstants.CHUNK_NODE_NAME + "_"
                + String.valueOf(Long.valueOf(indexBounds[1]) + 1) + "_*";
 
View Full Code Here


                public void remove() {
                    throw new UnsupportedOperationException();
                }

                public Resource next() {
                    Node next = nodes.nextNode();
                    try {
                        return new MockedResource(MockedResourceResolver.this,
                                next.getPath(), "nt:unstructured");
                    } catch (RepositoryException e) {
                        throw new RuntimeException("RepositoryException: " + e,
View Full Code Here

    public Iterator<Resource> findResources(String query, String language) {
        List<Resource> resources = new ArrayList<Resource>();
        try {
            NodeIterator iterator = session.getWorkspace().getQueryManager().createQuery(query, language).execute().getNodes();
            while (iterator.hasNext()) {
                Node n = iterator.nextNode();
                Resource resource = new MockedResource(this, n);
                resources.add(resource);
            }
        } catch (RepositoryException e) {
            LOG.error("Unable to execute JCR query", e);
View Full Code Here

    private void scanNode(final Node folder, final ScanResult result, final Set<String> resourcesSeen)
    throws RepositoryException {
        final NodeIterator it = folder.getNodes();
        while(it.hasNext()) {
            final Node n = it.nextNode();
            boolean processed = false;
            for (JcrInstaller.NodeConverter nc : converters) {
                final InstallableResource r = nc.convertNode(n, priority);
                if(r != null) {
                    processed = true;
View Full Code Here

            logger.debug("Not recursing into {} due to maxWatchedFolderDepth={}", path, maxWatchedFolderDepth);
            return;
        }
        final NodeIterator it = n.getNodes();
        while (it.hasNext()) {
            findPathsUnderNode(it.nextNode(), result);
        }
    }

    /**
     * Add WatchedFolder to our list if it doesn't exist yet.
View Full Code Here

            boolean result = node.hasNodes();
            if (result && logger.isDebugEnabled()) {
                List<String> nodeNames = new ArrayList<String>();
                NodeIterator childItr = node.getNodes();
                while (childItr.hasNext()) {
                    nodeNames.add(childItr.nextNode().getName());
                }
                logger.debug("Found child nodes {} at path {}. Scanning would be paused", nodeNames, pauseScanNodePath);
            }
            return result;
        }
View Full Code Here

            finalOrder = new ArrayList<String>();

            NodeIterator nodes = session.getNode("/content").getNodes();
            while (nodes.hasNext()) {
                finalOrder.add(nodes.nextNode().getName());
            }
        } finally {
            session.removeItem("/content");
            session.save();
            session.logout();
View Full Code Here

                resolver = rrFactory.getAdministrativeResourceResolver(null);
                Session session = resolver.adaptTo(Session.class);
                Node node = session.getNode(path);
                NodeIterator it = node.getNodes();
                while (it.hasNext()) {
                    it.nextNode().remove();
                    counter++;
                }
                session.save();

                resp.getWriter().printf("<p class='statline ui-state-error'>Deleted %s notifications</p>%n", counter);
View Full Code Here

      buffer.append("\n");
    }

    NodeIterator nodes = node.getNodes();
    while (nodes.hasNext()) {
      Node child = nodes.nextNode();
      buffer.append(dumpNode(child));
    }
    return buffer.toString();

  }
View Full Code Here

        NodeIterator nodes = test.getNodes();
        assertEquals(3, nodes.getSize());

        while (nodes.hasNext()) {
            String name = nodes.nextNode().getName();
            assertTrue(nodeNames.remove(name));
        }

        assertTrue(nodeNames.isEmpty());
    }
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.