Revision 5750d7cc

b/trunk/Pithos.Core/Agents/NetworkAgent.cs
310 310
                Log.Info("Scheduled");
311 311
                var client=new CloudFilesClient(accountInfo);
312 312

  
313
                var containers = client.ListContainers(accountInfo.UserName);
314
                
315
                CreateContainerFolders(accountInfo, containers);
316

  
317

  
313 318
                //Get the list of server objects changed since the last check
314 319
                var listObjects = Task<IList<ObjectInfo>>.Factory.StartNew(() =>
315 320
                                client.ListObjects(accountInfo.UserName, FolderConstants.PithosContainer, since));
......
396 401
            }
397 402
        }
398 403

  
404
        private static void CreateContainerFolders(AccountInfo accountInfo, IList<ContainerInfo> containers)
405
        {
406
            var containerPaths = from container in containers
407
                                 let containerPath = Path.Combine(accountInfo.AccountPath, container.Name)
408
                                 where container.Name != FolderConstants.TrashContainer && !Directory.Exists(containerPath)
409
                                 select containerPath;
410

  
411
            foreach (var path in containerPaths)
412
            {
413
                Directory.CreateDirectory(path);
414
            }
415
        }
416

  
399 417
        //Creates an appropriate action for each server file
400 418
        private IEnumerable<CloudAction> ObjectsToActions(AccountInfo accountInfo,IEnumerable<ObjectInfo> remote)
401 419
        {
......
851 869

  
852 870
                //Upload even small files using the Hashmap. The server may already containt
853 871
                //the relevant folder
854
/*
855
                if (fileInfo.Length > accountInfo.BlockSize )
856
                {
857
*/
858
                    //To upload using a hashmap
859
                    //First, calculate the tree hash
860
                    var treeHash = Signature.CalculateTreeHashAsync(fileInfo.FullName, accountInfo.BlockSize,
861
                        accountInfo.BlockHash);
862
                    yield return treeHash;
872

  
873
                //First, calculate the tree hash
874
                var treeHash = Signature.CalculateTreeHashAsync(fileInfo.FullName, accountInfo.BlockSize,
875
                    accountInfo.BlockHash);
876
                yield return treeHash;
863 877
                    
864
                    yield return Task.Factory.Iterate(UploadWithHashMap(accountInfo,cloudFile,fileInfo,url,treeHash));
865
                                        
866
/*
867
                }
868
                else
869
                {
870
                    //Otherwise do a regular PUT
871
                    yield return client.PutObject(account, container, url, fullFileName, hash);                    
872
                }
873
*/
878
                yield return Task.Factory.Iterate(UploadWithHashMap(accountInfo,cloudFile,fileInfo,url,treeHash));
879

  
874 880
                //If everything succeeds, change the file and overlay status to normal
875 881
                this.StatusKeeper.SetFileState(fullFileName, FileStatus.Unchanged, FileOverlayStatus.Normal);
876 882
            }
b/trunk/Pithos.Core/PithosMonitor.cs
124 124
            _accountInfo = CloudClient.Authenticate();
125 125
            _accountInfo.AccountPath = RootPath;
126 126

  
127

  
128
            var pithosFolder = Path.Combine(RootPath, FolderConstants.PithosContainer);
129
            if (!Directory.Exists(pithosFolder))
130
                Directory.CreateDirectory(pithosFolder);
127 131
            //Create the cache folder and ensure it is hidden
128 132
            CreateHiddenFolder(RootPath, FolderConstants.CacheFolder);
129 133

  
b/trunk/Pithos.Network/CloudFilesClient.cs
195 195
                if (client.StatusCode == HttpStatusCode.NoContent)
196 196
                    return new List<ContainerInfo>();
197 197
                var infos = JsonConvert.DeserializeObject<IList<ContainerInfo>>(content);
198
                
199
                foreach (var info in infos)
200
                {
201
                    info.Account = account;
202
                }
198 203
                return infos;
199 204
            }
200 205

  
b/trunk/Pithos.Network/ContainerInfo.cs
2 2
{
3 3
    public class ContainerInfo
4 4
    {
5
        public string Account { get; set; }
5 6
        public string Name { get; set; }
6 7
        public long Count { get; set; }
7 8
        public long Bytes { get; set; }
b/trunk/Pithos.Network/FolderConstants.cs
2 2
{
3 3
    public static class FolderConstants
4 4
    {
5
        public static readonly string OthersFolder="others";
5
        public static readonly string OthersFolder="others-shared";
6 6
        public static readonly string PithosContainer = "pithos";
7 7
        public static readonly string TrashContainer = "trash";
8 8

  

Also available in: Unified diff