Package javax.jcr

Examples of javax.jcr.Session.itemExists()


        session.refresh(false);
        // Make sure these items are not accessible after refresh(false);
        assertFalse(session.itemExists("/node1"));
        assertFalse(session.itemExists("/node1/node2"));
        assertFalse(session.itemExists("/node1/node3"));
        assertFalse(session.itemExists("/node1/node3/property1"));
    }

    @Test
    public void sessionRefreshFalse() throws RepositoryException {
View Full Code Here


        session.refresh(false);
        // Make sure these items are not accessible after refresh(false);
        assertFalse(session.itemExists("/node1"));
        assertFalse(session.itemExists("/node1/node2"));
        assertFalse(session.itemExists("/node1/node3"));
        assertFalse(session.itemExists("/node1/node3/property1"));
    }

    @Test
    public void sessionRefreshFalse() throws RepositoryException {
        Session session1 = createAdminSession();
View Full Code Here

    }

    @Test(expected = RepositoryException.class)
    public void testExceptionThrownForInvalidPath() throws RepositoryException {
        Session session = getAdminSession();
        session.itemExists("//jcr:content");
    }

    @Test
    @Ignore("OAK-1174"// FIXME OAK-1174
    public void testInvalidName() throws RepositoryException {
View Full Code Here

    public void testInvalidName() throws RepositoryException {
        Session session = getAdminSession();

        RepositoryException exception = null;
        try {
            session.itemExists("/jcr:cont]ent");
        } catch (RepositoryException e) {
            exception = e;
        }

        session.setNamespacePrefix("foo", "http://foo.bar");
View Full Code Here

            exception = e;
        }

        session.setNamespacePrefix("foo", "http://foo.bar");
        try {
            session.itemExists("/jcr:cont]ent");
            assertNull(exception);
        } catch (RepositoryException e) {
            assertNotNull(exception);
        }
    }
View Full Code Here

    private void checkJcrFlag() {
        setup.put(getPCName(), false);
        try {
            Session session = getJcrSession();
            if (session.itemExists("/" + SETUP_FLAG))
                setup.put(getPCName(), true);
            session.logout();
        } catch (Exception e) {
            throw new RuntimeException(e);
        }
View Full Code Here

     */
    public void removeMember(DavResource member) throws DavException {
        Session session = getRepositorySession();
        try {
            String itemPath = member.getLocator().getRepositoryPath();
            if (!exists() || !session.itemExists(itemPath)) {
                throw new DavException(DavServletResponse.SC_NOT_FOUND);
            }
            if (!getResourcePath().equals(Text.getRelativeParent(member.getResourcePath(), 1))) {
                throw new DavException(DavServletResponse.SC_CONFLICT, member.getResourcePath() + "is not member of this resource (" + getResourcePath() + ")");
            }
View Full Code Here

                // Import Lenya repository
                getLogger().debug("Importing Lenya repository into JCR");
                if (!JCR_LENYA_BASE_NAME.equals(firstNodeName)) {
                    throw new JCRImportException("Corrupt Lenya repository data file");
                }
                if (!session.itemExists(JCR_LENYA_ROOT)) {
                    throw new JCRImportException("Lenya JCR root not found [" + JCR_LENYA_ROOT + "]");
                }
                // Remove existing Lenya repository.
                String lenyaBasePath = JCR_LENYA_ROOT +
                    (JCR_LENYA_ROOT.endsWith("/") ? JCR_LENYA_BASE_NAME : "/" + JCR_LENYA_BASE_NAME);
View Full Code Here

                    throw new JCRImportException("Lenya JCR root not found [" + JCR_LENYA_ROOT + "]");
                }
                // Remove existing Lenya repository.
                String lenyaBasePath = JCR_LENYA_ROOT +
                    (JCR_LENYA_ROOT.endsWith("/") ? JCR_LENYA_BASE_NAME : "/" + JCR_LENYA_BASE_NAME);
                if (session.itemExists(lenyaBasePath)) {
                    Item jcrLenyaBase = session.getItem(lenyaBasePath);
                    jcrLenyaBase.remove();
                    session.save();
                }
   
View Full Code Here

                    throw new JCRImportException("Error importing data into workspace");
                }
            } else if (IMPORT_TARGET_PUBLICATION.equals(importTarget)) {
                // Import Lenya publication
                getLogger().debug("Importing Lenya publication into JCR");
                if (!session.itemExists(JCR_LENYA_PUBLICATON_ROOT)) {
                    throw new JCRImportException("Lenya JCR root not found [" + JCR_LENYA_ROOT + "]");
                    // TODO: Create JCR_LENYA_PUBLICATON_ROOT
                }
               
                // Remove existing Lenya repository.
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.