Examples of nodeExists()


Examples of java.util.prefs.Preferences.nodeExists()

                    .getResourceAsStream("/prefs/java/util/prefs/userprefs.xml");
            Preferences.importPreferences(in);

            prefs = Preferences.userNodeForPackage(PreferencesTest.class);
            assertEquals(1, prefs.childrenNames().length);
            assertTrue(prefs.nodeExists("mock/child/grandson"));
            assertEquals("newvalue", prefs.get("prefskey", null));
            assertEquals("oldvalue2", prefs.get("prefskey2", null));
            assertEquals("newvalue3", prefs.get("prefskey3", null));

            in = PreferencesTest.class
View Full Code Here

Examples of javax.jcr.Session.nodeExists()

        givePrivileges(childNPath, testUser.getPrincipal(), privileges, getRestrictions(superuser, childNPath));


        Session testSession = getTestSession();

        assertFalse(testSession.nodeExists(path));

        // reading the node and it's definition must succeed.
        assertTrue(testSession.nodeExists(childNPath));
        Node n = testSession.getNode(childNPath);
View Full Code Here

Examples of javax.jcr.Session.nodeExists()

        Session testSession = getTestSession();

        assertFalse(testSession.nodeExists(path));

        // reading the node and it's definition must succeed.
        assertTrue(testSession.nodeExists(childNPath));
        Node n = testSession.getNode(childNPath);

        n.addNode("someChild");
        n.save();
    }
View Full Code Here

Examples of javax.jcr.Session.nodeExists()

        // } finally {
        // pm.releaseConnection();
        // }

        Session session = login();
        if (session.nodeExists(path)) {
            session.removeItem(path);
            session.save();
        }
    }
View Full Code Here

Examples of javax.jcr.Session.nodeExists()

    public void createNode(String path, String primaryNodeType) throws RepositoryException {

        Session session = login();
        try {
            if (session.nodeExists(path)) {
                return;
            }

            Node parent = session.getNode(Text.getRelativeParent(path, 1));
            parent.addNode(Text.getName(path), primaryNodeType);
View Full Code Here

Examples of javax.jcr.Session.nodeExists()

    }

    public void createFile(String path, byte[] bytes) throws RepositoryException {
        Session session = login();
        try {
            if (session.nodeExists(path)) {
                return;
            }

            Node parent = session.getNode(Text.getRelativeParent(path, 1));
            Node resourceNode = parent.addNode(Text.getName(path), "nt:file");
View Full Code Here

Examples of javax.jcr.Session.nodeExists()

                if (session.hasPendingChanges()) {
                    session.save();
                    response.setStatus(HttpServletResponse.SC_CREATED);
                }
            } else if ("delete".equals(action)) {
                if (session.nodeExists("/testing/PathsServlet/foo")) {
                    session.getNode("/testing/PathsServlet/foo").remove();
                    if (session.hasPendingChanges()) {
                        session.save();
                    }
                    response.setStatus(HttpServletResponse.SC_NO_CONTENT);
View Full Code Here

Examples of javax.jcr.Session.nodeExists()

    @Test
    public void addNode() throws RepositoryException {
        Session session = getAdminSession();
        String newNode = TEST_PATH + "/new";
        assertFalse(session.nodeExists(newNode));

        Node node = getNode(TEST_PATH);
        Node added = node.addNode("new");
        assertFalse(node.isNew());
        assertTrue(node.isModified());
View Full Code Here

Examples of javax.jcr.Session.nodeExists()

        assertFalse(added.isModified());
        session.save();

        Session session2 = createAnonymousSession();
        try {
            assertTrue(session2.nodeExists(newNode));
            added = session2.getNode(newNode);
            assertFalse(added.isNew());
            assertFalse(added.isModified());
        } finally {
            session2.logout();
View Full Code Here

Examples of javax.jcr.Session.nodeExists()

    public void addNodeWithSpecialChars() throws RepositoryException {
        Session session = getAdminSession();
        String nodeName = "foo{";

        String newNode = TEST_PATH + '/' + nodeName;
        assertFalse(session.nodeExists(newNode));

        Node node = getNode(TEST_PATH);
        node.addNode(nodeName);
        session.save();
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.