public IEnumerable <AzureAppendBlobVirtualFile> GetImmediateFiles(string fromDirPath) { var dir = new AzureAppendBlobVirtualDirectory(this, fromDirPath); return(Container.ListBlobs((fromDirPath == null) ? null : fromDirPath + this.RealPathSeparator) .Where(q => q.GetType() == typeof(CloudAppendBlob)) .Select(q => new AzureAppendBlobVirtualFile(this, dir).Init(q as CloudAppendBlob))); }
public AzureAppendBlobVirtualFiles(string connectionString, string containerName) { var storageAccount = CloudStorageAccount.Parse(connectionString); //containerName is the name of Azure Storage Blob container Container = storageAccount.CreateCloudBlobClient().GetContainerReference(containerName); Container.CreateIfNotExists(); rootDirectory = new AzureAppendBlobVirtualDirectory(this, null); }
public AzureAppendBlobVirtualDirectory(AzureAppendBlobVirtualFiles pathProvider, string directoryPath) : base(pathProvider) { this.pathProvider = pathProvider; this.DirectoryPath = directoryPath; if (directoryPath == "/" || directoryPath.IsNullOrEmpty()) { return; } var separatorIndex = directoryPath.LastIndexOf(pathProvider.RealPathSeparator, StringComparison.Ordinal); ParentDirectory = new AzureAppendBlobVirtualDirectory(pathProvider, separatorIndex == -1 ? string.Empty : directoryPath.Substring(0, separatorIndex)); }
public AzureAppendBlobVirtualFiles(CloudBlobContainer container) { Container = container; Container.CreateIfNotExists(); rootDirectory = new AzureAppendBlobVirtualDirectory(this, null); }