Package javax.jcr

Examples of javax.jcr.Session.removeItem()


        };
        slingId = UUID.randomUUID().toString();
        Session l = RepositoryProvider.instance().getRepository()
                .loginAdministrative(null);
        try {
            l.removeItem("/var");
            l.save();
            l.logout();
        } catch (Exception e) {
            l.refresh(false);
            l.logout();
View Full Code Here


    public void activateAll(boolean resetRepo) throws Exception {
        if (resetRepo) {
            Session l = RepositoryProvider.instance().getRepository()
                    .loginAdministrative(null);
            try {
                l.removeItem("/var");
                l.save();
                l.logout();
            } catch (Exception e) {
                l.refresh(false);
                l.logout();
View Full Code Here

        try {
            if (replicationPackage != null) {
                session = getSession(resourceResolver);
                for (String path : replicationPackage.getPaths()) {
                    if (session.itemExists(path)) {
                        session.removeItem(path);
                    }
                }
                session.save();
                return true;
            }
View Full Code Here

                }

            }

        } finally {
            session.removeItem("/content");
            session.save();
            session.logout();
        }
    }
View Full Code Here

            Node content = session.getRootNode().getNode("content");
            assertThat(content.getPrimaryNodeType().getName(), equalTo("sling:Folder"));

        } finally {
            session.removeItem("/content");
            session.save();
            session.logout();

            IOUtils.closeQuietly(cndInput);
        }
View Full Code Here

            content = session.getRootNode().getNode("content");
            assertThat(content.getPrimaryNodeType().getName(), equalTo("nt:folder"));

        } finally {
            session.removeItem("/content");
            session.save();
            session.logout();

            IOUtils.closeQuietly(cndInput);
        }
View Full Code Here

            content = session.getRootNode().getNode("content");
            assertThat(content.getPrimaryNodeType().getName(), equalTo("custom"));

        } finally {
            session.removeItem("/content");
            session.save();
            session.logout();

            IOUtils.closeQuietly(cndInput);
        }
View Full Code Here

        // pm.releaseConnection();
        // }

        Session session = login();
        if (session.nodeExists(path)) {
            session.removeItem(path);
            session.save();
        }
    }

    public Node getNode(String nodePath) throws RepositoryException {
View Full Code Here

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

        assertThat("Incorrect node order", finalOrder, equalTo(expected));
View Full Code Here

    }

    @After
    public void tearDown() throws RepositoryException {
        Session s = testNode.getSession();
        s.removeItem(TEST_PATH);
        s.save();
    }

    @Test
    public void testCopyNode() throws RepositoryException {
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.