Rename the file and move it to its new location.

@param string $newKey
179688
public function rename($newKey)
    {
        $this->filesystem->rename($this->key, $newKey);

        $this->key = $newKey;
    }
1135987
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;
    }
253857
public function renameName($nameIndex, $newName)
    {
        $nameIndex = (int)$nameIndex;
        foreach ($this->positions as $position) {
            $source = $position->source;
            if ($source->nameIndex === $nameIndex) {
                $source->name = $newName;
            }
        }
    }
966430
public function rename($sourceKey, $targetKey)
    {
        if (false !== $this->write($targetKey, $this->read($sourceKey))) {
            $this->delete($sourceKey);

            return true;
        }

        return false;
    }
253753
private function renameKey()
    {
        try {
            list($file, $key) = explode('.', $this->argument('oldKey'), 2);
        } catch (\ErrorException $e) {
            $this->error('Could not recognize the key you want to rename.');

            return;
        }

        if (Str::contains($this->argument('newKey'), '.')) {
            $this->error('Please provide the new key must not contain a dot.');

            return;
        }

        $newKey = preg_replace('/(\w+)$/i', $this->argument('newKey'), $key);

        $files = $this->manager->files()[$file];

        $currentValues = [];

        foreach ($files as $languageKey => $filePath) {
            $content = Arr::dot($this->manager->getFileContent($filePath));

            $currentValues[$languageKey] = isset($content[$key]) ? $content[$key] : '';
        }

        $this->manager->removeKey($file, $key);

        $this->manager->fillKeys(
            $file,
            [$newKey => $currentValues]
        );
    }
790257
public function rename( $new_file )
    {
        $res = @rename( $this->path, $new_file->getPath() );
        if ( $res === FALSE ){
            throw new FileRenameException($this, $new_file);
        }
    }
1222591
public function rename($newpath)
    {
        if ($this->filesystem->rename($this->path, $newpath)) {
            $this->path = $newpath;

            return true;
        }

        return false;
    }
821210
public function rename($path, $newPath)
    {
        $resource = Uploader::rename(
            $this->converter->pathToId($path),
            $this->converter->pathToId($newPath)
        );

        return $this->addPathToResource($resource);
    }
1087531
public function rename($old_file, $new_file, $move = false)
	{
		if ( ! $this->_is_conn())
		{
			return false;
		}

		$result = @ftp_rename($this->_conn_id, $old_file, $new_file);

		if ($result === false)
		{
			if ($this->_debug == true)
			{
				$msg = ($move == false) ? 'Unable to rename' : 'Unable to move';

				throw new \FtpFileAccessException($msg);
			}
			return false;
		}

		return true;
	}
725102
public function rename($oldName, $newName)
	{
		$form = $this->get($oldName);
		$this->delete($oldName);
		$this->add($newName, $form['code'], $form['title']);
	}
297293
public function renameFile($filename, $rename)
    {
        $this->renameDirectory($this->absolutizePath($filename), $this->absolutizePath($rename));
    }
789080
public static function rename(String $oldName, String $newName) : Bool
    {
        $oldName = Info::rpath($oldName);

        if( ! file_exists($oldName) )
        {
            throw new Exception\FileNotFoundException(NULL, $oldName);
        }

        return rename($oldName, $newName);
    }
1256046
public function rename($path, $newPath)
    {
        if ($this->client->copyObject($this->bucket, $path, $this->bucket, $newPath) !== null) {
            $result = $this->client->deleteObject($this->bucket, $path);
            if (!is_null($result)) {
                return true;
            }
        }

        return false;
    }
898157
public function rename(String $oldName, String $newName) : Bool
    {
        if( @ssh2_sftp_rename($this->connect, $oldName, $newName) )
        {
            return true;
        }
        else
        {
            throw new FolderChangeNameException(NULL, $oldName);
        }
    }
73159
public function rename($currentKey, $newKey)
    {
        if ($this->has($currentKey)) {
            $this->set($newKey, $this->proxy->{$currentKey})->remove($currentKey);
        }

        return $this;
    }
714448
public function rename($path, $newpath)
    {
        list ($oldParent, $fileId) = $this->splitPath($path);
        list ($newParent, $newName) = $this->splitPath($newpath);

        $file = new Google_Service_Drive_DriveFile();
        $file->setName($newName);
        $opts = [
            'fields' => $this->fetchfieldsGet
        ];
        if ($newParent !== $oldParent) {
            $opts['addParents'] = $newParent;
            $opts['removeParents'] = $oldParent;
        }

        $updatedFile = $this->service->files->update($fileId, $file, $this->applyDefaultParams($opts, 'files.update'));

        if ($updatedFile) {
            $this->cacheFileObjects[$updatedFile->getId()] = $updatedFile;
            $this->cacheFileObjectsByName[$newParent . '/' . $newName] = $updatedFile;
            return true;
        }

        return false;
    }
1359941
def rename(self, old_key, new_key):
        
        assert new_key not in self
        assert old_key != new_key

        file_ = self[old_key]
        old_data = self.filesmap[old_key]

        # Create a new version with the new name
        obj = ObjectVersion.create(
            bucket=self.bucket, key=new_key,
            _file_id=file_.obj.file_id
        )

        # Delete old key
        self.filesmap[new_key] = self.file_cls(obj, old_data).dumps()
        del self[old_key]

        return obj