コード例 #1
0
        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)));
        }
コード例 #2
0
        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);
        }
コード例 #3
0
        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));
        }
コード例 #4
0
 public AzureAppendBlobVirtualFiles(CloudBlobContainer container)
 {
     Container = container;
     Container.CreateIfNotExists();
     rootDirectory = new AzureAppendBlobVirtualDirectory(this, null);
 }