String destAbsPath ) throws ItemExistsException, RepositoryException {
CheckArg.isNotNull(srcAbsPath, "srcAbsPath");
CheckArg.isNotNull(destAbsPath, "destAbsPath");
PathFactory pathFactory = executionContext.getValueFactories().getPathFactory();
Path destPath = pathFactory.create(destAbsPath);
Path.Segment newNodeName = destPath.getSegment(destPath.size() - 1);
// Doing a literal test here because the path factory will canonicalize "/node[1]" to "/node"
if (destAbsPath.endsWith("]")) {
throw new RepositoryException(JcrI18n.pathCannotHaveSameNameSiblingIndex.text(destAbsPath));
}
AbstractJcrNode sourceNode = getNode(pathFactory.create(srcAbsPath));
AbstractJcrNode newParentNode = getNode(destPath.getParent());
String newNodeNameAsString = newNodeName.getString(executionContext.getNamespaceRegistry());
if (newParentNode.hasNode(newNodeName.getString(executionContext.getNamespaceRegistry()))) {
throw new ItemExistsException(JcrI18n.childNodeAlreadyExists.text(newNodeNameAsString, newParentNode.getPath()));
}