try {
SshFile o = resolveFile(oldPath);
SshFile n = resolveFile(newPath);
if (!o.doesExist()) {
sendStatus(id, SSH_FX_NO_SUCH_FILE, o.getAbsolutePath());
} else if (n.doesExist()) {
sendStatus(id, SSH_FX_FILE_ALREADY_EXISTS, n.getAbsolutePath());
} else if (!o.move(n)) {
sendStatus(id, SSH_FX_FAILURE, "Failed to rename file");
} else {
sendStatus(id, SSH_FX_OK, "");