Beispiel #1
0
        public StoreCloudDirectory CreateDirectory(StoreCloud storeCloud, string virtualPath)
        {
            virtualPath = StoreCloudTools.CorrectVirtualPath(virtualPath);
            StoreCloudDirectory dir = null;

            try
            {
                //controles
                //if (!NGLib.DATA.FORMAT.StringUtilities.IsValidForXML(form.ti)) throw new Exception("IDStore invalide");
                //if (form.IDStore.Length < 8) throw new Exception("IDStore minLength");

                // insertion
                dir             = new StoreCloudDirectory();
                dir.IDStore     = storeCloud.IDStore.ToString();
                dir.VirtualPath = virtualPath;

                base.InsertBubble(dir); //,false,true);

                //// Création
                //swift.CreateContainer(dir.IDStore.ToString());

                //// Si tous est pret on active
                //dir.Valid = ENUMS.StoreCloudValid.OK;
                //base.SaveBubble(dir);
                return(dir);
            }
            catch (Exception ex)
            {
                throw new Exception("CreateDirectory " + ex.Message, ex);
            }
        }
Beispiel #2
0
        public void deleteDirectory(StoreCloud storeCloud, string virtualPath)
        {
            virtualPath = StoreCloudTools.CorrectVirtualPath(virtualPath);
            StoreCloudDirectory dir = null;

            try
            {
                dir = GetDirectorys(storeCloud.IDStore.ToString(), virtualPath).FirstOrDefault();
                var items   = GetItemsByDirectory(storeCloud, virtualPath);
                var iditems = GetItemsByDirectory(storeCloud, virtualPath).Select(i => i.IDItem);
                foreach (var item in iditems)
                {
                    base.DeleteBubble(items.FirstOrDefault(i => i.IDItem == item));
                }

                base.DeleteBubble(dir);
            }
            catch (Exception ex)
            {
                throw new Exception("CreateDirectory " + ex.Message, ex);
            }
        }