public function renameFile(FileInfo $fileInfo, $new_file_name)
    {
        try {
            $this->validateFile($fileInfo, $new_file_name);
            $fm = new Filesystem();
            $old_file = $fileInfo->getFilepath(true);
            $new_file = $new_file_name;
            $fm->rename($old_file, $new_file);
        } catch (\Exception $e) {
            $this->getFileManager()->throwError("Cannot rename file or directory", 500, $e);
        }
    }
public function renameFile(FileInfo $fileInfo, $new_file_name)
    {
        try {
            $this->validateFile($fileInfo, $new_file_name);
            $fm = new Filesystem();
            $old_file = $fileInfo->getFilepath(true);
            $new_file = $new_file_name;
            $fm->rename($old_file, $new_file);
        } catch (\Exception $e) {
            $this->getFileManager()->throwError("Cannot rename file or directory", 500, $e);
        }
    }
public function renameFile ( FileInfo $ fileInfo , $ new_file_name ) { try { $ this -> validateFile ( $ fileInfo , $ new_file_name ) ; $ fm = new Filesystem ( ) ; $ old_file = $ fileInfo -> getFilepath ( true ) ; $ new_file = $ new_file_name ; $ fm -> rename ( $ old_file , $ new_file ) ; } catch ( \ Exception $ e ) { $ this -> getFileManager ( ) -> throwError ( "Cannot rename file or directory" , 500 , $ e ) ; } }
Renames the file

@param FileInfo $fileInfo
@param string   $new_file_name
Renames the file