Moves this directory to the given destination. Returns a Folder object
        that represents the moved directory.
490441
def rename_to(self, destination_name):
        
        target = self.parent.child_folder(destination_name)
        logger.info("Rename %s to %s" % (self, target))
        shutil.move(self.path, unicode(target))
        return target
1078375
def move(self, auth, resource, destinationresource, options={"aliases": True}, defer=False):
        
        return self._call('move', auth, [resource, destinationresource, options], defer)
144530
def move(ctx, client, sources, destination):
    """"""
    from renku.api._git import _expand_directories

    dst = Path(destination)

    def fmt_path(path):
        """Format path as relative to the client path."""
        return str(Path(path).absolute().relative_to(client.path))

    files = {
        fmt_path(source): fmt_path(file_or_dir)
        for file_or_dir in sources
        for source in _expand_directories((file_or_dir, ))
    }

    def fmt_dst(path):
        """Build a destination path for a source path."""
        return str(dst / os.path.relpath(path, start=files[path]))

    destinations = {source: fmt_dst(source) for source in files}

    # 1. Check .gitignore.
    ignored = client.find_ignored_paths(*destinations.values())
    if ignored:
        click.echo(WARNING + 'Renamed files match .gitignore.\n')
        if click.confirm(
            'Do you want to edit ".gitignore" now?', default=False
        ):
            click.edit(filename=str(client.path / '.gitignore'))

    # 2. Update dataset metadata files.
    with progressbar(
        client.datasets.items(),
        item_show_func=lambda item: str(item[1].short_id) if item else '',
        label='Updating dataset metadata',
        width=0,
    ) as bar:
        for (path, dataset) in bar:
            renames = {}

            for file in dataset.files:
                filepath = fmt_path(os.path.normpath(str(path.parent / file)))

                if filepath in files:
                    renames[file] = os.path.relpath(
                        destinations[filepath], start=str(path.parent)
                    )

            if renames:
                dataset = dataset.rename_files(
                    lambda key: renames.get(key, key)
                )

                dataset.to_yaml()

    # 3. Manage .gitattributes for external storage.
    tracked = tuple(
        path for path, attr in client.find_attr(*files).items()
        if attr.get('filter') == 'lfs'
    )
    client.untrack_paths_from_storage(*tracked)
    existing = client.find_attr(*tracked)
    if existing:
        click.echo(WARNING + 'There are custom .gitattributes.\n')
        if click.confirm(
            'Do you want to edit ".gitattributes" now?', default=False
        ):
            click.edit(filename=str(client.path / '.gitattributes'))

    client.track_paths_in_storage(*(destinations[path] for path in tracked))

    # 4. Handle symlinks.
    dst.parent.mkdir(parents=True, exist_ok=True)

    for source, target in destinations.items():
        src = Path(source)
        if src.is_symlink():
            Path(target).parent.mkdir(parents=True, exist_ok=True)
            Path(target).symlink_to(
                os.path.relpath(
                    str(src.resolve()), start=os.path.dirname(target)
                )
            )
            src.unlink()
            del files[source]

    # Finally move the files.
    final_sources = list(set(files.values()))
    if final_sources:
        run(['git', 'mv'] + final_sources + [destination], check=True)
575939
def mkdir(self, name=None, folder_id='0'):
		''''''
		return self( 'folders', method='post', encode='json',
			data=dict(name=name, parent=dict(id=folder_id)) )
1083396
void copyTo(final File destinationFolder) throws IOException {
    for (final File f : this.theFiles) {
      final File destinationFile = new File(destinationFolder, f.getName());
      Files.copy(f.toPath(), destinationFile.toPath(), java.nio.file.StandardCopyOption.REPLACE_EXISTING);
    }
  }
490633
def fs_move(from, to)
      FileUtils.mv(File.join(self.git_dir, from), File.join(self.git_dir, to))
    end
1111237
def move(self, folder, **kwargs):
        '''
        

        '''

        if self._proj is None:
            raise DXError("Move called when a project ID was not associated with this object handler")

        dxpy.api.project_move(self._proj, {"objects": [self._dxid],
                                           "destination": folder},
                              **kwargs)
268668
def chdir(directory):
    
    try:
        olddir = os.getcwd()
    except OSError:
        olddir = None
    os.chdir(directory)
    return olddir
1148165
def move_folder(self, to_folder):
        
        if self.root:
            return False
        if not to_folder:
            return False

        url = self.build_url(
            self._endpoints.get('get_folder').format(id=self.folder_id))

        if isinstance(to_folder, ContactFolder):
            folder_id = to_folder.folder_id
        elif isinstance(to_folder, str):
            folder_id = to_folder
        else:
            return False

        response = self.con.patch(url,
                                  data={self._cc('parentFolderId'): folder_id})
        if not response:
            return False

        folder = response.json()

        self.name = folder.get(self._cc('displayName'), '')
        self.parent_id = folder.get(self._cc('parentFolderId'), None)

        return True
944091
private function move($destination, $tmp, $filename)
    {
        if (!is_dir($destination)) {
            // We can either create it automatically
            if ($this->destinationAutoCreate === true) {
                // Then make a directory (recursively if needed)
                @mkdir($destination, 0777, true);
                
            } else {
                // Destination doesn't exist, and we shouldn't be creating it
                throw new RuntimeException(sprintf(
                    'Destination folder does not exist', $destination
                ));
            }
        }

        $target = sprintf('%s/%s', $destination, $filename);

        // If Remote file exists and we don't want to override it, so let's stop here
        if (is_file($target)) {
            if (!$this->override) {
                return true;
            }
        }

        return move_uploaded_file($tmp, $target);
    }
305382
@Override
    public T move(String source, String target) throws IllegalArgumentException, IllegalArchivePathException {
        Validate.notNullOrEmpty(source, "The source path was not specified");
        Validate.notNullOrEmpty(target, "The target path was not specified");

        final ArchivePath sourcePath = new BasicPath(source);
        final ArchivePath targetPath = new BasicPath(target);

        return move(sourcePath, targetPath);
    }
510484
def destination(globs, locator, distance, bearing):
    """"""
    globs.locations.destination(distance, bearing, locator)
608308
protected boolean moveDirectory(Path src, Path target) throws IOException {
        if(Files.exists(src)) {
            createDirectoryIfNotExists(target.getParent());
            deleteDirectory(target, false);
            Files.move(src, target);
            cleanEmptyParentDirectory(src.getParent());
            return true;
        }
        else {
            return false;
        }
    }
96067
def move_file_to_directory(file_path, directory_path):
        
        file_name = os.path.basename(file_path)  # get name of file
        if not os.path.exists(directory_path):
            os.makedirs(directory_path)  # create directory if necessary
        os.rename(file_path, os.path.join(directory_path,
                                          file_name))
16268
private static void moveFile(final File fromFile, final File toFile) throws UpdateException {
        try {
            // Create parent directory structure if necessary
            FileUtils.mkParentDirs(toFile);
            Files.move(fromFile.toPath(), toFile.toPath(),
                    StandardCopyOption.REPLACE_EXISTING);
        } catch (IOException ioe) {
            throw new UpdateException("Unable to move temporary file to destination file: " +
                    fromFile + " -> " + toFile + ": " + ioe.toString());
        }
    }
695661
def _move_to_store(self, srcpath, objhash):
        
        destpath = self.object_path(objhash)
        if os.path.exists(destpath):
            # Windows: delete any existing object at the destination.
            os.chmod(destpath, S_IWUSR)
            os.remove(destpath)
        os.chmod(srcpath, S_IRUSR | S_IRGRP | S_IROTH)  # Make read-only
        move(srcpath, destpath)
913384
def extract(self, destination):
        

        if os.path.exists(destination):
            raise OSError(20, 'Destination exists', destination)

        self.__extract_directory(
            '.',
            self.files['files'],
            destination
        )