final NodeId destParentNodeId,
final Name destName) throws NoSuchWorkspaceException, ConstraintViolationException, VersionException, AccessDeniedException, PathNotFoundException, ItemExistsException, LockException, UnsupportedRepositoryOperationException, RepositoryException {
final SessionInfoImpl sInfo = getSessionInfoImpl(sessionInfo);
executeWithLocalEvents(new Callable() {
public Object run() throws RepositoryException {
Workspace ws = sInfo.getSession().getWorkspace();
String destPath = getDestinationPath(destParentNodeId, destName, sInfo);
if (ws.getName().equals(srcWorkspaceName)) {
// inner-workspace copy
String srcPath = pathForId(srcNodeId, sInfo);
ws.copy(srcPath, destPath);
} else {
SessionInfoImpl srcInfo = getSessionInfoImpl(obtain(sInfo, srcWorkspaceName));
try {
String srcPath = pathForId(srcNodeId, srcInfo);
ws.copy(srcWorkspaceName, srcPath, destPath);
} finally {
dispose(srcInfo);
}
}
return null;