Rename a folder or a subfolder.

    The routes for this endpoint are:

    * ``POST /dossier/v1/<fid_src>/rename/<fid_dest>``
    * ``POST /dossier/v1/<fid_src>/subfolder/<sfid_src>/rename/
      <fid_dest>/subfolder/<sfid_dest>``
971001
def v1_folder_rename(request, response, kvlclient,
                     fid_src, fid_dest, sfid_src=None, sfid_dest=None):
    '''
    '''
    src, dest = make_path(fid_src, sfid_src), make_path(fid_dest, sfid_dest)
    new_folders(kvlclient, request).move(src, dest)
    response.status = 200
1189814
@Override
  public boolean rename(Path src, Path dst) throws IOException {
    FTPClient client = connect();
    try {
      boolean success = rename(client, src, dst);
      return success;
    } finally {
      disconnect(client);
    }
  }
492057
def __rename_path(self, source, target):
        

        if not foundations.common.path_exists(source):
            return

        parent_directory = os.path.dirname(source)
        is_path_registered = self.__engine.file_system_events_manager.is_path_registered(parent_directory)
        is_path_registered and self.__engine.file_system_events_manager.unregister_path(parent_directory)
        os.rename(source, target)
        is_path_registered and self.__engine.file_system_events_manager.register_path(parent_directory)
1370317
def rename(self, new, parents=False):
        
        if parents:
            os.renames(self.path, self._to_backend(new))
        else:
            os.rename(self.path, self._to_backend(new))
404342
private function renamePathsForCreatedFiles(): void
    {
        foreach ($this->filesCreated as $key => $realPath) {
            $this->filesCreated[$key] = $this->pathHelper->renamePathBasenameSingularOrPlural(
                $realPath,
                $this->singularNamespacedName,
                $this->pluralNamespacedName
            );
        }
    }
1077779
def move(self, key, folder):
        
        # Basically this is a sophisticated __delitem__
        # We need the path so we can make it in the new folder
        path, host, flags = self._exists(key)
        self._invalidate_cache()

        # Now, move the message file to the new folder
        newpath = joinpath(
            folder.base, 
            folder.get_name(), 
            "cur",     # we should probably move it to new if it's in new
            basename(path)
            )
        self.filesystem.rename(path, newpath)
        # And update the caches in the new folder
        folder._invalidate_cache()
1350847
def rename_file(self, old_save_name, new_save_name, new_path):
        
        if old_save_name in self._files:
            del self._files[old_save_name]
        self.update_file(new_save_name, new_path)
192887
public boolean rename(Path src, Path dst) throws IOException {
    return dfs.rename(getPathName(src), getPathName(dst));
  }
510316
function renameFiles(files)
{
  files.forEach(function (file)
  {
    var originalName = path.basename(file);
    var newFileName = originalName.toLowerCase();
    var directory = path.dirname(file);
    if (originalName != newFileName)
    {
      fs.renameSync(file, directory + "/" + newFileName); //, function(err)

      if (debug)
        console.log('Renamed: %s --> %s', originalName, newFileName);

      originalFiles.push(originalName);
      renamedFiles.push(newFileName);
    }
  });
}
1027978
public static void renamePath(FileSystem fs, Path oldName, Path newName) throws IOException {
    renamePath(fs, oldName, newName, false);
  }
621998
def rename(self, rename_pair_list, **kwargs):
        
        foo = []
        for path, newname in rename_pair_list:
            foo.append({'path': path,
                        'newname': newname
                        })

        data = {'filelist': json.dumps(foo)}
        params = {
            'opera': 'rename'
        }

        url = 'http://{0}/api/filemanager'.format(BAIDUPAN_SERVER)
        logging.debug('rename ' + str(data) + 'URL:' + url)
        return self._request('filemanager', 'rename', url=url, data=data, extra_params=params, **kwargs)
73962
def file_rename(object_id, input_params={}, always_retry=True, **kwargs):
    
    return DXHTTPRequest('/%s/rename' % object_id, input_params, always_retry=always_retry, **kwargs)
1382
def rename_document(self, did, name):
        '''
        
        '''

        payload = {
            'name': name
        }

        return self._api.request('post', '/api/documents/' + did, body=payload)
1215581
def rename(src, dst):
    '''
    
    '''
    src = os.path.expanduser(src)
    dst = os.path.expanduser(dst)

    if not os.path.isabs(src):
        raise SaltInvocationError('File path must be absolute.')

    try:
        os.rename(src, dst)
        return True
    except OSError:
        raise CommandExecutionError(
            'Could not rename \'{0}\' to \'{1}\''.format(src, dst)
        )
    return False
1122936
function rename(filepath, options) {
	var base = filepath.substr(0, filepath.lastIndexOf('.'));
	return base + (options.extname || '.html');
}
940427
public void rename(String oldpath, String newpath)
			throws SftpStatusException, SshException {
		String from = resolveRemotePath(oldpath);
		String to = resolveRemotePath(newpath);

		SftpFileAttributes attrs = null;

		try {
			attrs = sftp.getAttributes(to);

		} catch (SftpStatusException ex) {
			sftp.renameFile(from, to);
			return;
		}

		if (attrs != null && attrs.isDirectory()) {
			sftp.renameFile(from, to);
		} else {
			throw new SftpStatusException(
					SftpStatusException.SSH_FX_FILE_ALREADY_EXISTS, newpath
							+ " already exists on the remote filesystem");
		}

	}
471625
function rename(oldPath, newPath, callback) {
  var oldBase = nodePath.dirname(oldPath);
  var newBase = nodePath.dirname(newPath);
  if (oldBase === newBase) {
    return nodeFs.rename(oldPath, newPath, callback);
  }
  mkdirp(nodePath.dirname(path), function (err) {
    if (err) return callback(err);
    nodeFs.rename(oldPath, newPath, callback);
  });
}