Ejemplo n.º 1
0
 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();
     }
 }