VirtoCommerce.Platform.Data.Asset.AzureBlobProvider.CreateFolder C# (CSharp) Méthode

CreateFolder() public méthode

public CreateFolder ( VirtoCommerce.Platform.Core.Asset.BlobFolder folder ) : void
folder VirtoCommerce.Platform.Core.Asset.BlobFolder
Résultat void
        public void CreateFolder(BlobFolder folder)
        {
            var path = (folder.ParentUrl != null ? folder.ParentUrl + "/" : String.Empty ) + folder.Name;

            var containerName = GetContainerNameFromUrl(path);
            var blobContainer = _cloudBlobClient.GetContainerReference(containerName);
            blobContainer.CreateIfNotExists(BlobContainerPublicAccessType.Blob);

            var directoryPath = GetDirectoryPathFromUrl(path);
            if (!String.IsNullOrEmpty(directoryPath))
            {
                //Need upload empty blob because azure blob storage not support direct directory creation
                blobContainer.GetBlockBlobReference(directoryPath).UploadText(String.Empty);
            }
        }