public AzureBlobPersistenceSystem(Enums.FileType fileType, Enums.FileSubType fileSubType, string folder) : base(fileType, fileSubType, folder) { CloudStorageAccount storageAccount = CloudStorageAccount.Parse(CloudConfigurationManager.GetSetting("StorageConnectionString")); // Create a CloudBlobClient object for credentialed access to storage. CloudBlobClient client = storageAccount.CreateCloudBlobClient(); // Get a reference to the blob container. switch (FileType) { case Enums.FileType.Modelo: blobContainer = client.GetContainerReference("modelos"); break; } }
public AzureFilePersistenceSystem(Enums.FileType fileType, Enums.FileSubType fileSubType, string folder) : base(fileType, fileSubType, folder) { CloudStorageAccount storageAccount = CloudStorageAccount.Parse(CloudConfigurationManager.GetSetting("StorageConnectionString")); // Create a CloudFileClient object for credentialed access to File storage. CloudFileClient fileClient = storageAccount.CreateCloudFileClient(); // Get a reference to the file share we created previously. CloudFileShare share = null; switch (FileType) { case Enums.FileType.Photo: share = fileClient.GetShareReference("photos"); break; } // Ensure that the share exists. if (share.Exists()) { // Get a reference to the root directory for the share. CloudFileDirectory rootDir = share.GetRootDirectoryReference(); // Get a reference to the directory we created previously. fileDirectory = rootDir.GetDirectoryReference(((int)FileSubType).ToString()); if (!fileDirectory.Exists()) { fileDirectory.Create(); } fileDirectory = fileDirectory.GetDirectoryReference(Folder); if (!fileDirectory.Exists()) { fileDirectory.Create(); } } }
public LocalPersistenceSystem(Enums.FileType fileType, Enums.FileSubType fileSubType, string folder) : base(fileType, fileSubType, folder) { }