Esempio n. 1
0
 /// <summary>
 /// Copy files. See: https://github.com/FrendsPlatform/Frends.File#Copy
 /// </summary>
 /// <returns>List [ Object { string SourcePath, string Path } ]</returns>
 public static async Task <IList <FileInBatchResult> > Copy(
     [PropertyTab] CopyInput input,
     [PropertyTab] CopyOptions options,
     CancellationToken cancellationToken)
 {
     return(await ExecuteActionAsync(() => CopyCommand.ExecuteAsync(input, options, cancellationToken),
                                     options.UseGivenUserCredentialsForRemoteConnections, options.UserName, options.Password).ConfigureAwait(false));
 }
Esempio n. 2
0
 public static async Task MoveFilesAsync(string sourceFilePath, string targetFilePath, CancellationToken cancellationToken)
 {
     // reuse copy, source files will be deleted after all have finished
     // TODO: for move between directories on the same disk, the File.Move would be more performant, but also could not be rolled back
     await CopyCommand.CopyFileAsync(sourceFilePath, targetFilePath, cancellationToken).ConfigureAwait(false);
 }