Revision 759bd3c4 trunk/Pithos.Core/Agents/PollAgent.cs

b/trunk/Pithos.Core/Agents/PollAgent.cs
189 189

  
190 190
                try
191 191
                {
192
                    //Wait for any deletions to finish
192 193
                    await NetworkAgent.GetDeleteAwaiter();
193 194
                    //Get the poll time now. We may miss some deletions but it's better to keep a file that was deleted
194 195
                    //than delete a file that was created while we were executing the poll                    
......
242 243

  
243 244
                        var differencer = _differencer.PostSnapshot(accountInfo, cleanRemotes);
244 245

  
245
                        ProcessDeletedFiles(accountInfo, differencer.Deleted, pollTime);
246
                        ProcessDeletedFiles(accountInfo, differencer.Deleted.FilterBelow(SelectiveUris), pollTime);
247

  
248
                        // @@@ NEED To add previous state here as well, To compare with previous hash
249

  
250
                        
246 251

  
247 252
                        //Create a list of actions from the remote files
248
                        var allActions = ChangesToActions(accountInfo, differencer.Changed)
253
                        var allActions = ChangesToActions(accountInfo, differencer.Changed.FilterBelow(SelectiveUris))
249 254
                                        .Union(
250
                                        CreatesToActions(accountInfo, differencer.Created));
255
                                        CreatesToActions(accountInfo, differencer.Created.FilterBelow(SelectiveUris)));
251 256

  
252 257
                        //And remove those that are already being processed by the agent
253 258
                        var distinctActions = allActions
......
275 280
        }
276 281

  
277 282
        AccountsDifferencer _differencer = new AccountsDifferencer();
283
        private List<Uri> _selectiveUris=new List<Uri>();
278 284

  
279 285
        /// <summary>
280 286
        /// Deletes local files that are not found in the list of cloud files
......
451 457
                Directory.CreateDirectory(path);
452 458
            }
453 459
        }
460

  
461
        public void SetSyncUris(string[] uris)
462
        {
463
            var selectiveUris = uris.Select(uri => new Uri(uri));
464
            SelectiveUris=selectiveUris.ToList();
465
        }
466

  
467
        protected List<Uri> SelectiveUris
468
        {
469
            get { return _selectiveUris;}
470
            set { _selectiveUris = value; }
471
        }
454 472
    }
455 473
}

Also available in: Unified diff