Changeset 2167


Ignore:
Timestamp:
6/13/2010 4:11:06 AM (5 years ago)
Author:
lowjoel
Message:

Forward-port from Eraser 6.0: Handle UnauthorizedAccessExceptions? when erasing folders, as certain folders allow us to erase the files within but not the folder itself.

Location:
trunk/eraser
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/eraser

  • trunk/eraser/Eraser.DefaultPlugins/ErasureTargets/FolderErasureTarget.cs

    r2149 r2167  
    212212            if (files.Length == 0) 
    213213            { 
    214                 ManagerLibrary.Instance.FileSystemRegistrar[ 
    215                     VolumeInfo.FromMountPoint(Path)].DeleteFolder(info); 
     214                try 
     215                { 
     216                    ManagerLibrary.Instance.FileSystemRegistrar[ 
     217                        VolumeInfo.FromMountPoint(Path)].DeleteFolder(info); 
     218                } 
     219                catch (UnauthorizedAccessException) 
     220                { 
     221                    Logger.Log(new LogEntry(S._("The folder {0} could not be deleted because " + 
     222                        "the folder's permissions prevents the deletion of the folder.", 
     223                        info.FullName), LogLevel.Error)); 
     224                } 
    216225            } 
    217226        } 
Note: See TracChangeset for help on using the changeset viewer.