Пример #1
0
 internal IEnumerable <WebRoute> ListFolder()
 {
     if (request is HttpWebRequest)
     {
         throw new NotImplementedException();
     }
     if (request is FileWebRequest)
     {
         DirectoryInfo dir = new DirectoryInfo(request.RequestUri.LocalPath);
         return(dir.GetFiles("*", new EnumerationOptions()
         {
             RecurseSubdirectories = true
         }).Select(f =>
                   WebRoute.Create(new Uri("file://" + f.FullName), Convert.ToUInt64(f.Length))));
     }
     if (request is FtpWebRequest)
     {
         throw new NotImplementedException();
     }
     if (request is S3WebRequest)
     {
         return(ListFolder((S3WebRequest)request.CloneRequest(request.RequestUri)));
     }
     return(null);
 }
Пример #2
0
 public async Task <Stream> GetStreamAsync(long start, long end = -1)
 {
     return(await WebRoute.Create(Uri).GetStreamAsync(start, end));
 }
Пример #3
0
 public async Task <Stream> GetStreamAsync()
 {
     return(await WebRoute.Create(Uri).GetStreamAsync());
 }