Esempio n. 1
0
 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));
 }
Esempio n. 2
0
 public virtual Task <bool> DeleteFileAsync(FileDescriptor file)
 {
     return(DeleteAsync(FilePaths.GetFilePath(file)));
 }
Esempio n. 3
0
 public string GetTrashFilePath(FileDescriptor fileDescriptor) => Path.Combine(TrashFolderPath, fileDescriptor.UniqueName);