public async Task Delete(string path) { if (await Hosting.IsDirectoryAsync(path)) { await Hosting.RemoveDirectoryAsync(path, true); } else { await Hosting.RemoveFileAsync(path); } }
public async Task Download(string from, string to = null) { to = to ?? from; Console.WriteLine($"download '{from}' -> '{to}'"); if (await Hosting.IsFileAsync(from)) { await Hosting.DownloadFileAsync(from, new FileInfo(to), new ConsoleProgressProvider()); } else if (await Hosting.IsDirectoryAsync(from)) { await Hosting.DownloadDirectoryAsync(from, new DirectoryInfo(to), failures, successes); } else { throw new ItemNotFound(); } }