Selective Sync filtering modified to allow uploading only of new root-level folders
[pithos-ms-client] / trunk / Pithos.Core / Agents / Uploader.cs
index 59ddf66..9a36adc 100644 (file)
@@ -24,7 +24,6 @@ namespace Pithos.Core.Agents
         [Import]\r
         private IStatusKeeper StatusKeeper { get; set; }\r
 \r
-        \r
         public IStatusNotification StatusNotification { get; set; }\r
 \r
         \r
@@ -137,6 +136,15 @@ namespace Pithos.Core.Agents
                                     //Go on and create the directory\r
                                     await client.PutObject(account, cloudFile.Container, cloudFile.Name, fullFileName,\r
                                                          String.Empty, "application/directory");\r
+                                //If the upload is in response to a Folder create with Selective Sync enabled\r
+                                if (action.IsCreation)\r
+                                {\r
+                                    //Add the folder to the Selected URls\r
+                                    var selections = Selectives.SelectiveUris[accountInfo.AccountKey];\r
+                                    var selectiveUri = new Uri(client.RootAddressUri, cloudFile.Uri);\r
+                                    selections.Add(selectiveUri);\r
+                                    Selectives.Save(accountInfo);\r
+                                }\r
                             }\r
                             else\r
                             {\r