Package org.apache.jackrabbit.oak.api

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


        if (!src.exists()) {
            throw new PathNotFoundException(srcPath);
        }

        try {
            if (!moveRoot.move(srcPath, destPath)) {
                throw new RepositoryException("Cannot move node at " + srcPath + " to " + destPath);
            }
            if (!transientOp) {
                saveTime = clock.getTime();
                saveCount++;
View Full Code Here


        if (!src.exists()) {
            throw new PathNotFoundException(srcPath);
        }

        try {
            if (!moveRoot.move(srcPath, destPath)) {
                throw new RepositoryException("Cannot move node at " + srcPath + " to " + destPath);
            }
            if (!transientOp) {
                sessionCounters.saveTime = clock.getTime();
                sessionCounters.saveCount++;
View Full Code Here

        if (!src.exists()) {
            throw new PathNotFoundException(srcPath);
        }

        try {
            if (!moveRoot.move(srcPath, destPath)) {
                throw new RepositoryException("Cannot move node at " + srcPath + " to " + destPath);
            }
            if (!transientOp) {
                saveTime = clock.getTime();
                saveCount++;
View Full Code Here

        if (!src.exists()) {
            throw new PathNotFoundException(srcPath);
        }

        try {
            if (!moveRoot.move(srcPath, destPath)) {
                throw new RepositoryException("Cannot move node at " + srcPath + " to " + destPath);
            }
            if (!transientOp) {
                sessionStats.save();
                commit(moveRoot);
View Full Code Here

        }

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

        try {
            if (!moveRoot.move(srcPath, destPath)) {
                throw new RepositoryException("Cannot move node at " + srcPath + " to " + destPath);
            }
            if (!transientOp) {
                moveRoot.commit();
                refresh(true);
View Full Code Here

        if (src == null) {
            throw new PathNotFoundException(srcPath);
        }

        try {
            moveRoot.move(srcPath, destPath);
            if (!transientOp) {
                moveRoot.commit();
            }
        } catch (CommitFailedException e) {
            e.throwRepositoryException();
View Full Code Here

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

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

        assertTrue(tree.hasChild("x"));
        root.move("/x", "/y/xx");
        assertFalse(tree.hasChild("x"));
        assertTrue(y.hasChild("xx"));
       
        root.commit();
        tree = root.getTree("/");
View Full Code Here

        Root root = session.getLatestRoot();
        Tree r = root.getTree("/");
        r.addChild("a");
        r.addChild("b");

        root.move("/a", "/b/c");
        assertFalse(r.hasChild("a"));
        assertTrue(r.hasChild("b"));

        r.getChild("b").remove();
        assertFalse(r.hasChild("a"));
View Full Code Here

    public void rename() throws CommitFailedException {
        Root root = session.getLatestRoot();
        Tree tree = root.getTree("/");

        assertTrue(tree.hasChild("x"));
        root.move("/x", "/xx");
        assertFalse(tree.hasChild("x"));
        assertTrue(tree.hasChild("xx"));
       
        root.commit();
        tree = root.getTree("/");
View Full Code Here

        Tree x = r.getChild("x");
        Tree y = r.getChild("y");

        assertFalse(y.hasChild("x"));
        assertEquals("", x.getParent().getName());
        root.move("/x", "/y/x");
        assertTrue(y.hasChild("x"));
        // assertEquals("y", x.getParent().getName());  // passed on JR2, fails on Oak
        assertEquals("", x.getParent().getName());      // fails on JR2, passes on Oak
    }
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.