public function rename($oldName, $newName) {
        if (false === ssh2_sftp_rename($this->getSFTP(), $oldName, $newName)) {
            throw $this->newFTPException(sprintf("rename %s into %s failed", $oldName, $newName));
        }
        return $this;
    }
public function rename($oldName, $newName) {
        if (false === ssh2_sftp_rename($this->getSFTP(), $oldName, $newName)) {
            throw $this->newFTPException(sprintf("rename %s into %s failed", $oldName, $newName));
        }
        return $this;
    }
public function rename ( $ oldName , $ newName ) { if ( false === ssh2_sftp_rename ( $ this -> getSFTP ( ) , $ oldName , $ newName ) ) { throw $ this -> newFTPException ( sprintf ( "rename %s into %s failed" , $ oldName , $ newName ) ) ; } return $ this ; }
Renames a file or a directory on the SFTP server.

@param string $oldName The old file/directory name.
@param string $newName The new name.
@return SFTPClient Returns this SFTP client.
@throws FTPException Throws a FTP exception if an I/O error occurs.
Renames a file or a directory on the SFTP server .