Transfers the files.
495225
public function promise()
    {
        // If the promise has been created, just return it.
        if (!$this->promise) {
            // Create an upload/download promise for the transfer.
            $this->promise = $this->sourceMetadata['scheme'] === 'file'
                ? $this->createUploadPromise()
                : $this->createDownloadPromise();
        }

        return $this->promise;
    }
145291
public static void copy(@NotNull Path from, @NotNull Path to) throws IOException {
		Validate.notNull(from);
		Validate.notNull(to);

		if (Files.isDirectory(from)) {
			copyDir(from, to);
		} else {
			copyFile(from, to);
		}
	}
92262
private static void transferImpl(BitReader reader, BitWriter writer, long count) {
		while (count >= 64) {
			//TODO could benefit from reading into a larger buffer here - eg bytes?
			long bits = reader.readLong(64);
			writer.write(bits, 64);
			count -= 64;
		}
		if (count != 0L) {
			long bits = reader.readLong((int) count);
			writer.write(bits, (int) count);
		}
	}
865653
def files(self, data):
        """"""
        current_files = self.files
        if current_files:
            raise RuntimeError('Can not update existing files.')
        for key in data:
            current_files[key] = data[key]
1192852
protected function doRelocation()
    {
        if (!$this->_original) {
            return;
        }

        if (is_dir($this->_original->path())) {
            if ($this->_action === 'move') {
                Folder::move($this->_original->path(), $this->path());
            } elseif ($this->_action === 'copy') {
                Folder::copy($this->_original->path(), $this->path());
            }
        }

        if ($this->name() !== $this->_original->name()) {
            $path = $this->path();
            if (is_file($path . '/' . $this->_original->name())) {
                rename($path . '/' . $this->_original->name(), $path . '/' . $this->name());
            }
        }

    }
664057
def _sendFiles(
        self, files, message=None, thread_id=None, thread_type=ThreadType.USER
    ):
        
        thread_id, thread_type = self._getThread(thread_id, thread_type)
        data = self._getSendData(
            message=self._oldMessage(message),
            thread_id=thread_id,
            thread_type=thread_type,
        )

        data["action_type"] = "ma-type:user-generated-message"
        data["has_attachment"] = True

        for i, (file_id, mimetype) in enumerate(files):
            data["{}s[{}]".format(mimetype_to_key(mimetype), i)] = file_id

        return self._doSendRequest(data)
87550
public static void transfer(InputStream from, OutputStream to) throws IOException
	{
		from = new BufferedInputStream(requireNotNull(from), BUFFER);
		to = new BufferedOutputStream(requireNotNull(to), BUFFER);

		final byte[] buf = new byte[BUFFER];
		int read;

		while ((read = from.read(buf)) != -1)
		{
			to.write(buf, 0, read);
		}

		to.flush();
	}
1277839
function( dataTransfer, callback ) {
                var results  = [],
                    promises = [],
                    items, files, file, item, i, len, canAccessFolder;
    
                items = dataTransfer.items;
                files = dataTransfer.files;
    
                canAccessFolder = !!(items && items[ 0 ].webkitGetAsEntry);
    
                for ( i = 0, len = files.length; i < len; i++ ) {
                    file = files[ i ];
                    item = items && items[ i ];
    
                    if ( canAccessFolder && item.webkitGetAsEntry().isDirectory ) {
    
                        promises.push( this._traverseDirectoryTree(
                                item.webkitGetAsEntry(), results ) );
                    } else {
                        results.push( file );
                    }
                }
    
                Base.when.apply( Base, promises ).done(function() {
    
                    if ( !results.length ) {
                        return;
                    }
    
                    callback( results );
                });
            }
454608
public void putFiles(String local, FileTransferProgress progress,
			boolean resume) throws FileNotFoundException, SftpStatusException,
			SshException, TransferCancelledException {
		putFiles(local, pwd(), progress, resume);
	}
661240
public void put(String local, FileTransferProgress progress)
			throws FileNotFoundException, SftpStatusException, SshException,
			TransferCancelledException {
		put(local, progress, false);
	}
1162666
def transfer_all(cls, field_mappings, sources, destination_factory=None):
    """"""
    for index, source in enumerate(sources):
      try:
        yield cls.transfer(field_mappings, source, destination_factory or (lambda x: x))
      except Exception as ex:
        raise Exception("Error with source #{0}: {1}".format(index, ex)) from ex
801401
private void transfer(Entry[] src, Entry[] dest)
    {
        for (int j = 0; j < src.length; ++j)
        {
            Entry e = src[j];
            src[j] = null;
            while (e != null)
            {
                Entry next = e.next;
                Object key = e.get();
                if (key == null || (timeToLive > 0 && ((TimedEntry)e).isExpired(timeToLive)))
                {
                    e.next = null;  // Help GC
                    size--;
                }
                else
                {
                    int i = indexFor(e.hash, dest.length);
                    e.next = dest[i];
                    dest[i] = e;
                }
                e = next;
            }
        }
    }
172084
public static void move(String srcPath, String dstPath) throws IOException {
    Files.move(Paths.get(srcPath), Paths.get(dstPath), StandardCopyOption.REPLACE_EXISTING);
  }
1128494
private void transfer(Entry[] src, Entry[] dest)
    {
        for (int j = 0; j < src.length; ++j)
        {
            Entry e = src[j];
            src[j] = null;
            while (e != null)
            {
                Entry next = e.next;
                int i = indexFor(e.hash, dest.length);
                e.next = dest[i];
                dest[i] = e;
                e = next;
            }
        }
    }
1040677
def up_by_files(to_sync, remote_dir=DEFAULT_REMOTE_DIR, remote_files=None):
    """"""
    if remote_files is None:
        remote_files = command.map_files_raw(remote_dir=remote_dir)
    for local_file in to_sync:
        _sync_local_file(local_file, remote_dir, remote_files)
1133692
public function transfer($source, $path = null)
    {
        $path = $path === null ? $this->output : $path;

        $path = $this->realpath($path);

        $source = (string) $this->realpath($source);

        $directory = new \RecursiveDirectoryIterator($source, 4096);

        $iterator = new \RecursiveIteratorIterator($directory, 1);

        foreach ($iterator as $file) {
            $to = str_replace($source, $path, $from = $file->getRealPath());

            $file->isDir() ? $this->transfer($from, $to) : copy($from, $to);
        }
    }
925916
private function appendCollectedFileAndChanges(): void
    {
        if (!empty($this->currentFile)) {
            foreach ($this->currentChanges as $change) {
                $this->currentFile->addChange($change);
            }
            $this->files[] = $this->currentFile;
        }
        $this->currentChanges = [];
    }