Package org.apache.jackrabbit.oak.api

Examples of org.apache.jackrabbit.oak.api.Root.copy()


        accessManager.checkPermissions(destPath, Permissions.getString(Permissions.NODE_TYPE_MANAGEMENT));

        try {
            Root currentRoot = contentSession.getLatestRoot();
            currentRoot.copy(srcPath, destPath);
            currentRoot.commit();
        } catch (CommitFailedException e) {
            throw newRepositoryException(e);
        }
    }
View Full Code Here


            ContentSession contentSession = sessionContext.getContentSession();
            Root root = contentSession.getCurrentRoot();

            String srcPath = PathUtils.relativize("/", srcAbsPath);
            String destPath = PathUtils.relativize("/", destAbsPath);
            root.copy(srcPath, destPath);

            root.commit();
        }
        catch (CommitFailedException e) {
            throw new RepositoryException(e);
View Full Code Here

        Tree y = tree.getChild("y");
        Tree x = tree.getChild("x");
        assertTrue(x.exists());

        assertTrue(tree.hasChild("x"));
        root.copy("/x", "/y/xx");
        assertTrue(tree.hasChild("x"));
        assertTrue(y.hasChild("xx"));
       
        root.commit();
View Full Code Here

        Tree tree = root.getTree("/");

        Tree y = tree.getChild("y");

        root.getTree("/x").addChild("x1");
        root.copy("/x", "/y/xx");
        assertTrue(y.hasChild("xx"));
        assertTrue(y.getChild("xx").hasChild("x1"));

        root.commit();
View Full Code Here

        root2.commit();

        root1.copy("/x", "/y/x-copied");
        root1.rebase();

        root2.copy("/x", "/y/x-copied");
        checkEqual(root1.getTree("/"), (root2.getTree("/")));
    }

    private static void checkEqual(Tree tree1, Tree tree2) {
        assertEquals(tree1.getChildrenCount(), tree2.getChildrenCount());
View Full Code Here

            throw new PathNotFoundException(srcAbsPath);
        }

        try {
            Root currentRoot = contentSession.getCurrentRoot();
            currentRoot.copy(srcPath, destPath);
            currentRoot.commit(DefaultConflictHandler.OURS);
        }
        catch (CommitFailedException e) {
            e.throwRepositoryException();
        }
View Full Code Here

            throw new PathNotFoundException(srcAbsPath);
        }

        try {
            Root currentRoot = contentSession.getCurrentRoot();
            currentRoot.copy(srcPath, destPath);
            currentRoot.commit(DefaultConflictHandler.OURS);
        }
        catch (CommitFailedException e) {
            e.throwRepositoryException();
        }
View Full Code Here

            throw new PathNotFoundException(srcPath);
        }

        try {
            Root currentRoot = contentSession.getLatestRoot();
            currentRoot.copy(srcPath, destPath);
            currentRoot.commit(DefaultConflictHandler.OURS);
        }
        catch (CommitFailedException e) {
            e.throwRepositoryException();
        }
View Full Code Here

            throw new PathNotFoundException(srcPath);
        }

        try {
            Root currentRoot = contentSession.getLatestRoot();
            currentRoot.copy(srcPath, destPath);
            currentRoot.commit();
        }
        catch (CommitFailedException e) {
            e.throwRepositoryException();
        }
View Full Code Here

        Tree tree = root.getTree("/");

        Tree y = tree.getChild("y");

        assertTrue(tree.hasChild("x"));
        root.copy("/x", "/y/xx");
        assertTrue(tree.hasChild("x"));
        assertTrue(y.hasChild("xx"));
       
        root.commit();
        tree = root.getTree("/");
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.