Esempio n. 1
0
        /* Methode Permettant de Lister tous les fichiers dans un Dossier du container donnée en parametre
         * Remarque Si ce Dossier n'existe pas au préalable il sera créer et renvera vide
         */
        public List<BlobInformation> GetFileFolder(string Directory)
        {
            try
            {
                var list = blobManager.container.GetDirectoryReference(Directory).ListBlobs();
                int cpt = 0;
                foreach (IListBlobItem item in list)
                {
                    BlobInformation blobInformation = new BlobInformation(item.Uri.AbsolutePath, item.Uri.AbsolutePath);
                    blobInformations.Add(blobInformation);
                    cpt++;
                }

                if (cpt == 0)
                {
                    blobInformations.Add(new BlobInformation("None", "None"));
                }

            }
            catch (ArgumentNullException)
            {
                Trace.TraceInformation("Parametre de l'URL Incorrect");
            }

            return blobInformations;
        }
Esempio n. 2
0
        /* Methode Permettant de lister tous les Dossiers présent dans le Répertoire Root du Container */
        public List<BlobInformation> GetRootFolder()
        {
            var list = blobManager.container.ListBlobs();
            foreach (IListBlobItem item in list)
            {
                var type = item.GetType();
                if (type == typeof(CloudBlobDirectory))
                {
                    string[] name = item.Uri.AbsolutePath.Split('/');

                    BlobInformation blobInformation = new BlobInformation(name[3], item.Uri.AbsolutePath);
                    blobInformations.Add(blobInformation);
                }
            }

            return blobInformations;
        }