public virtual async Task <bool> DownloadAsync(FileDescriptor fileDescriptor, string targetPath) { using var fileStream = System.IO.File.OpenWrite(targetPath); // Use await instead of returning the task to make sure the filestream gets disposed only after the method finishes. return(await DownloadAsync(fileStream, FilePaths.GetFilePath(fileDescriptor)).ConfigureAwait(false)); }
public virtual Task <bool> DeleteFileAsync(FileDescriptor file) { return(DeleteAsync(FilePaths.GetFilePath(file))); }
public string GetTrashFilePath(FileDescriptor fileDescriptor) => Path.Combine(TrashFolderPath, fileDescriptor.UniqueName);