AzureBlobFileSystem.AzureBlobStorageProvider.DeleteFolder C# (CSharp) Method

DeleteFolder() public method

public DeleteFolder ( string path ) : void
path string
return void
        public void DeleteFolder(string path)
        {
            var fullPath = path;
            var container = EnsurePathIsRelativeAndEnsureContainer(ref path);

            if (path == "")
            {
                Containers.Remove(container);
                container.Delete();
                return;
            }

            container.EnsureDirectoryExists(path);
            foreach (var blob in container.GetDirectoryReference(path).ListBlobs())
            {
                if (blob is CloudBlockBlob)
                    ((CloudBlockBlob)blob).Delete();

                if (blob is CloudBlobDirectory)
                    DeleteFolder(new AzureBlobFolderStorage((CloudBlobDirectory)blob, this).GetPath());
            }
        }