Пример #1
0
 public Stream CreateContentStream()
 {
     try
     {
         return(FileStreamCache.Get(Item));
     }
     catch (FileNotFoundException ex)
     {
         Error("Failed to access: " + Item.FullName, ex);
         //Server.DelayedRescan(WatcherChangeTypes.Deleted);
         throw;
     }
     catch (UnauthorizedAccessException ex)
     {
         Error("Failed to access: " + Item.FullName, ex);
         //Server.DelayedRescan(WatcherChangeTypes.Changed);
         throw;
     }
     catch (IOException ex)
     {
         Error("Failed to access: " + Item.FullName, ex);
         //Server.DelayedRescan(WatcherChangeTypes.Changed);
         throw;
     }
 }
Пример #2
0
 public override void Close()
 {
     if (!killed)
     {
         FileStreamCache.Recycle(this);
         return;
     }
     base.Close();
     logger.DebugFormat("Closed file {0}", info.FullName);
 }