Revision 6bcdd8e2 trunk/Pithos.Core/Agents/PollAgent.cs

b/trunk/Pithos.Core/Agents/PollAgent.cs
352 352
                var deletedFiles = new List<FileSystemInfo>();
353 353
                foreach (var objectInfo in cloudFiles)
354 354
                {
355
                    Log.DebugFormat("Handle deleted [{0}]",objectInfo.Uri);
355 356
                    var relativePath = objectInfo.RelativeUrlToFilePath(accountInfo.UserName);
356 357
                    var item = FileAgent.GetFileAgent(accountInfo).GetFileSystemInfo(relativePath);
358
                    Log.DebugFormat("Will delete [{0}] for [{1}]", item.FullName,objectInfo.Uri);
357 359
                    if (item.Exists)
358 360
                    {
359 361
                        if ((item.Attributes & FileAttributes.ReadOnly) == FileAttributes.ReadOnly)
......
361 363
                            item.Attributes = item.Attributes & ~FileAttributes.ReadOnly;
362 364

  
363 365
                        }
364
                        item.Delete();
366
                        var directory = item as DirectoryInfo;
367
                        if (directory!=null)
368
                            directory.Delete(true);
369
                        else
370
                            item.Delete();
371
                        Log.DebugFormat("Deleted [{0}] for [{1}]", item.FullName, objectInfo.Uri);
365 372
                        DateTime lastDate;
366 373
                        _lastSeen.TryRemove(item.FullName, out lastDate);
367 374
                        deletedFiles.Add(item);
368 375
                    }
369 376
                    StatusKeeper.SetFileState(item.FullName, FileStatus.Deleted, FileOverlayStatus.Deleted);
370 377
                }
378
                Log.InfoFormat("[{0}] files were deleted",deletedFiles.Count);
371 379
                StatusNotification.NotifyForFiles(deletedFiles, String.Format("{0} files were deleted", deletedFiles.Count), TraceLevel.Info);
372 380
            }
373 381

  

Also available in: Unified diff