Change node name without move method

Scott_Przy 30-10-2018

Found a similar thread here: Need java code to convert the page names to lower case which a staff member posted this bit of code:

void rename(Node node, String newName) throws RepositoryException

    {

        node.getSession().move(node.getPath(), node.getParent().getPath() + "/" + newName.toLowerCase());  //

      

        node.getSession().save();

    }

which is close to what I need except that when its executed the node structure is changed and the newly named node is pushed to the bottom and I need it to maintain position in the structure.

Accepted Solutions (1)

Accepted Solutions (1)

Answers (3)

Answers (3)