How can you change the name of a JCR node?

家住魔仙堡 提交于 2019-12-10 15:09:48

问题


I'm trying to change the name of a JCR node, but I have no idea how? Has someone of you some hints?

Many thanks.


回答1:


The Jackrabbit Wiki provides an example:

void rename(Node node, String newName) throws RepositoryException 
    {
        node.getSession().move(node.getPath(), node.getParent().getPath() + "/" + newName);
        // Don't forget - not necessarily here at this place:
        // node.getSession().save();
    }


来源:https://stackoverflow.com/questions/4164995/how-can-you-change-the-name-of-a-jcr-node

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!