Beispiel #1
0
 public async Task Put(string remotename, System.IO.Stream stream, CancellationToken cancelToken)
 {
     using (System.IO.FileStream writestream = systemIO.FileCreate(GetRemoteName(remotename)))
     {
         if (random.NextDouble() > 0.6666)
         {
             throw new Exception("Random upload failure");
         }
         await Utility.Utility.CopyStreamAsync(stream, writestream, cancelToken);
     }
 }