Revision 0a9d4d18 trunk/Pithos.Core/Agents/PollAgent.cs

b/trunk/Pithos.Core/Agents/PollAgent.cs
399 399
                    {
400 400
                        if (gate.Failed)
401 401
                            continue;
402
                        StatusKeeper.SetFileState(item.FullName, FileStatus.Conflict, FileOverlayStatus.Deleted);
402
                        StatusKeeper.SetFileState(item.FullName, FileStatus.Conflict, FileOverlayStatus.Deleted,"Local file missing from server");
403 403
                    }
404 404
                }
405 405
                UpdateStatus(PithosStatus.HasConflicts);
......
438 438
                        _lastSeen.TryRemove(item.FullName, out lastDate);
439 439
                        deletedFiles.Add(item);
440 440
                    }
441
                    StatusKeeper.SetFileState(item.FullName, FileStatus.Deleted, FileOverlayStatus.Deleted);
441
                    StatusKeeper.SetFileState(item.FullName, FileStatus.Deleted, FileOverlayStatus.Deleted, "File Deleted");
442 442
                }
443 443
                Log.InfoFormat("[{0}] files were deleted",deletedFiles.Count);
444 444
                StatusNotification.NotifyForFiles(deletedFiles, String.Format("{0} files were deleted", deletedFiles.Count), TraceLevel.Info);
......
557 557
                    Log.DebugFormat("[NEW INFO] {0}",objectInfo.Uri);
558 558

  
559 559
                var relativePath = objectInfo.RelativeUrlToFilePath(accountInfo.UserName);
560
                //If the object already exists, we probably have a conflict
560

  
561
                //If the object already exists, we should check before uploading or downloading
561 562
                if (fileAgent.Exists(relativePath))
562 563
                {
563
                    Log.DebugFormat("[SKIP EXISTING] {0}", objectInfo.Uri);
564
                    //If a directory object already exists, we don't need to perform any other action                    
565
                    var localFile = fileAgent.GetFileSystemInfo(relativePath);
566
                    StatusKeeper.SetFileState(localFile.FullName, FileStatus.Conflict, FileOverlayStatus.Conflict);
564
                    var localFile= fileAgent.GetFileSystemInfo(relativePath);
565
                    var state = StatusKeeper.GetStateByFilePath(localFile.WithProperCapitalization().FullName);
566
                    yield return new CloudAction(accountInfo, CloudActionType.MustSynch,
567
                                                     localFile, objectInfo, state, accountInfo.BlockSize,
568
                                                     accountInfo.BlockHash);                    
567 569
                }
568 570
                else
569 571
                {
570 572
                    //Remote files should be downloaded
571 573
                    yield return new CloudDownloadAction(accountInfo, objectInfo);
572 574
                }
575

  
573 576
            }
574 577
        }
575 578

  

Also available in: Unified diff