Changeset 2653
- Timestamp:
- 5/24/2012 2:57:09 AM (13 months ago)
- Location:
- trunk/eraser/Eraser.DefaultPlugins/ErasureTargets
- Files:
-
- 3 edited
-
FileSystemObjectErasureTarget.cs (modified) (1 diff)
-
FolderErasureTarget.cs (modified) (1 diff)
-
RecycleBinErasureTarget.cs (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/eraser/Eraser.DefaultPlugins/ErasureTargets/FileSystemObjectErasureTarget.cs
r2646 r2653 224 224 //Retrieve the list of files to erase. 225 225 List<StreamInfo> paths = GetPaths(); 226 long dataTotal = paths.Sum(x => x.Length); 226 long dataTotal = paths.Sum(delegate(StreamInfo x) { 227 try 228 { 229 return x.Length; 230 } 231 catch (DirectoryNotFoundException) 232 { 233 return 0; 234 } 235 catch (FileNotFoundException) 236 { 237 return 0; 238 } 239 }); 227 240 228 241 //Set the event's current target status. -
trunk/eraser/Eraser.DefaultPlugins/ErasureTargets/FolderErasureTarget.cs
r2606 r2653 147 147 continue; 148 148 149 //Add the size of the file and its alternate data streams 150 result.AddRange(GetPathADSes(file)); 151 152 //And the file itself 153 result.Add(new StreamInfo(file.FullName)); 149 try 150 { 151 //Add the size of the file and its alternate data streams 152 result.AddRange(GetPathADSes(file)); 153 154 //And the file itself 155 result.Add(new StreamInfo(file.FullName)); 156 } 157 catch (FileNotFoundException) 158 { 159 Logger.Log(S._("The file {0} was not erased because it was deleted " + 160 "before it could be erased.", file.FullName), LogLevel.Information); 161 } 162 catch (DirectoryNotFoundException) 163 { 164 Logger.Log(S._("The file {0} was not erased because the containing " + 165 "directory was deleted before it could be erased", file.FullName), 166 LogLevel.Information); 167 } 154 168 } 155 169 -
trunk/eraser/Eraser.DefaultPlugins/ErasureTargets/RecycleBinErasureTarget.cs
r2606 r2653 141 141 foreach (FileInfo file in GetFiles(directory)) 142 142 { 143 //Add the ADSes 144 result.AddRange(GetPathADSes(file)); 143 try 144 { 145 //Add the ADSes 146 result.AddRange(GetPathADSes(file)); 145 147 146 //Then the file itself 147 result.Add(new StreamInfo(file.FullName)); 148 //Then the file itself 149 result.Add(new StreamInfo(file.FullName)); 150 } 151 catch (FileNotFoundException) 152 { 153 Logger.Log(S._("The file {0} was not erased because it was deleted " + 154 "before it could be erased.", file.FullName), LogLevel.Information); 155 } 156 catch (DirectoryNotFoundException) 157 { 158 Logger.Log(S._("The file {0} was not erased because the containing " + 159 "directory was deleted before it could be erased", file.FullName), 160 LogLevel.Information); 161 } 148 162 } 149 163
Note: See TracChangeset
for help on using the changeset viewer.
