Renames existing image

@param string $oldFileName
@param string $newFileName
@param string $context
@param string $storage

@return boolean
545508
public static function renameImage($oldFileName, $newFileName, $context, $storage = 'local')
    {
        /** @var FilesystemAdapter $filesystemAdapter */
        $filesystemAdapter = Facades\Storage::disk($storage);
        /** @var Processor $processor */
        $processor = app('icr.processor');

        return $processor->rename($oldFileName, $newFileName, $context, $filesystemAdapter);
    }
515121
public function renameFolder($cb, $oldName, $newName)
    {
        $this->onResponse->push($cb);
        $this->writeln(self::TAG_RENAMEFOLDER . " RENAME "
            .$this->escapeString($oldName)." ".$this->escapeString($newName));
    }
88886
public function renameColumn($oldName, $newName)
    {
        foreach ($this->getDataTables() as $table) {
            $table->renameColumn($oldName, $newName);
        }
    }
181468
public function rename(string $oldName, string $newName)
    {
        if (!@ftp_rename($this->ftp, $oldName, $newName)) {
            throw new Exception(sprintf("Cannot rename file from %s to %s", $oldName, $newName));
        }

        return $this;
    }
604289
public function rename($oldName, $newName)
    {
        if (! ftp_rename($this->session, $oldName, $newName)) {
            throw new \RuntimeException('Name can not be changed');
        }
        return true;
    }
700549
public static function rename($oldName, $newName, $context = null)
    {
        return self::resourceExists($oldName) ? rename($oldName, $newName, $context) : false;
    }
500338
public function rename( $fileName )
	{
		if( !$fileName )
			throw new InvalidArgumentException( 'No File Name given.' );
		$result	= @rename( $this->fileName, $fileName );
		if( $result === FALSE )
			throw new RuntimeException( 'File "'.$this->fileName.'" could not been renamed.' );
		$this->__construct( $fileName );
		return $result;
	}
7118
public function rename($bucketName, $bucketId, $fileName, $targetBucketId, $newFileName, $private = false)
    {
        $data = $this->get($bucketName, $fileName, $private, false);
        if (is_array($data) && array_key_exists('x-bz-file-id', $data['headers'])) {
            $result = $this->insert($targetBucketId, $data['content'], $newFileName);
            if ($result === false) {
                return false;
            }
            $response = $this->client->b2DeleteFileVersion($this->apiURL, $this->token, $data['headers']['x-bz-file-id'], $fileName);

            return $response->isOk();
        }

        return false;
    }
676955
public function rename($path, $originalFileName, $newFileName)
    {
        $path = $this->cleanFolder($path);
        $nameName = $path.DIRECTORY_SEPARATOR.$newFileName;
        if ($this->disk->exists($nameName)) {
            $this->errors[] = 'The file "'.$newFileName.'" already exists in this folder.';

            return false;
        }

        return $this->disk->getDriver()->rename(($path.DIRECTORY_SEPARATOR.$originalFileName), $nameName);
    }
249356
public static void rename(FileSystem fs, String oldName, String newName)
    throws IOException {
    Path oldDir = new Path(oldName);
    Path newDir = new Path(newName);
    if (!fs.rename(oldDir, newDir)) {
      throw new IOException("Could not rename " + oldDir + " to " + newDir);
    }
  }
54802
def rename_file(old, new, path=None):
    
    cwd = os.getcwd()
    try:
        if path:
            os.chdir(path)
    except OSError:
        raise
    try:
        os.rename(old, new)
        os.chdir(cwd)
        return True
    except OSError:
        os.chdir(cwd)
        raise
213223
public function rename($oldName, $newName) {
        if (false === @ftp_rename($this->getConnection(), $oldName, $newName)) {
            throw $this->newFTPException(sprintf("rename %s into %s failed", $oldName, $newName));
        }
        return $this;
    }
208172
public function renameFolder($name, $newname) {
        return imap_renamemailbox($this->imap, $this->mailbox . $name, $this->mailbox . $newname);
    }
1006521
public function rename($old, $new)
    {
        return ($this->isConnected() === true) ? ftp_rename($this->getConnection(), $old, $new) : false;
    }
757981
def rename_file(self, old_path, new_path):
        
        self.log.debug("S3contents.GenericManager: Init rename of '%s' to '%s'", old_path, new_path)
        if self.file_exists(new_path) or self.dir_exists(new_path):
            self.already_exists(new_path)
        elif self.file_exists(old_path) or self.dir_exists(old_path):
            self.log.debug("S3contents.GenericManager: Actually renaming '%s' to '%s'", old_path,
                           new_path)
            self.fs.mv(old_path, new_path)
        else:
            self.no_such_entity(old_path)
700738
@Override
  public int rename(String oldPath, String newPath) {
    final AlluxioURI oldUri = mPathResolverCache.getUnchecked(oldPath);
    final AlluxioURI newUri = mPathResolverCache.getUnchecked(newPath);
    LOG.trace("rename({}, {}) [Alluxio: {}, {}]", oldPath, newPath, oldUri, newUri);

    try {
      mFileSystem.rename(oldUri, newUri);
      synchronized (mOpenFiles) {
        if (mOpenFiles.contains(PATH_INDEX, oldPath)) {
          OpenFileEntry oe = mOpenFiles.getFirstByField(PATH_INDEX, oldPath);
          oe.setPath(newPath);
        }
      }
    } catch (FileDoesNotExistException e) {
      LOG.debug("Failed to rename {} to {}, file {} does not exist", oldPath, newPath, oldPath);
      return -ErrorCodes.ENOENT();
    } catch (FileAlreadyExistsException e) {
      LOG.debug("Failed to rename {} to {}, file {} already exists", oldPath, newPath, newPath);
      return -ErrorCodes.EEXIST();
    } catch (Throwable t) {
      LOG.error("Failed to rename {} to {}", oldPath, newPath, t);
      return AlluxioFuseUtils.getErrorCode(t);
    }

    return 0;
  }
666496
public function rename($groupName, $newName, $container)
    {
        $groupDn = $this->dn($groupName);

        if ($groupDn) {
            $newRDN = 'CN='.$newName;

            // Determine the container
            $container = array_reverse($container);
            $container = 'OU='.implode(', OU=', $container);

            $dn = $container.', '.$this->adldap->getBaseDn();

            return $this->connection->rename($groupDn, $newRDN, $dn, true);
        }

        return false;
    }