BlobRequestOptions.UseFlatBlobListing Property
Assembly: Microsoft.WindowsAzure.StorageClient (in Microsoft.WindowsAzure.StorageClient.dll)
/** @property */ /** @attribute CompilerGeneratedAttribute() */ public boolean get_UseFlatBlobListing () /** @property */ /** @attribute CompilerGeneratedAttribute() */ public void set_UseFlatBlobListing (boolean value)
CompilerGeneratedAttribute public function get UseFlatBlobListing () : boolean CompilerGeneratedAttribute public function set UseFlatBlobListing (value : boolean)
Property Value
Type: System.BooleanTrue if blobs will be listed in a flat listing; otherwise, false. The default value is false.
The following code example lists blobs in both a virtual hierarchy and a flat listing, and shows some possible results.
static void ListBlobsInVirtualDirectory(Uri blobEndpoint, string accountName, string accountKey) { //Create service client for credentialed access to the Blob service. CloudBlobClient blobClient = new CloudBlobClient(blobEndpoint, new StorageCredentialsAccountAndKey(accountName, accountKey)); //List blobs in container 'mycontainer' beginning with prefix 'a/', using a hierarchical listing. //The results list only blobs directly beneath 'mycontainer/a/' foreach (var blobItem in blobClient.ListBlobsWithPrefix("mycontainer/a/")) { Console.WriteLine(blobItem.Uri); } //Hierarchical listing results: //http://storagesample.blob.core.windows.net/mycontainer/a/00001.txt //http://storagesample.blob.core.windows.net/mycontainer/a/b/ Console.WriteLine(); //List blobs in container 'mycontainer' beginning with prefix 'a/', using a flat listing. //The results list all blobs beneath 'mycontainer/a/', even if they are in a subdirectory. BlobRequestOptions options = new BlobRequestOptions(); options.UseFlatBlobListing = true; foreach (var blobItem in blobClient.ListBlobsWithPrefix("mycontainer/a/", options)) { Console.WriteLine(blobItem.Uri); } //Flat listing results: //http://storagesample.blob.core.windows.net/mycontainer/a/00001.txt //http://storagesample.blob.core.windows.net/mycontainer/a/b/00002.txt //http://storagesample.blob.core.windows.net/mycontainer/a/b/c/00003.txt //http://storagesample.blob.core.windows.net/mycontainer/a/b/c/00004.txt //http://storagesample.blob.core.windows.net/mycontainer/a/b/c/00005.txt //http://storagesample.blob.core.windows.net/mycontainer/a/b/c/00006.txt }
This property is applicable only to a request to list blobs.
By default, a blob listing operation lists blobs using a virtual hierarchy. In a hierarchical blob listing, a delimiter character used within blob names is treated as a path separator. The listing operation lists the blobs directly beneath a container or a virtual directory only. The listing operation may return objects of type CloudBlob and type CloudBlobDirectory.
Setting the UseFlatBlobListing to true lists blobs in a flat listing instead of in a virtual hierarchy. In a flat blob listing, all blobs beneath the designated starting point are returned, regardless of their position in a virtual hierarchy. A flat blob listing returns only objects of type CloudBlob.
To include snapshots in the listing, you must use a flat listing.
Development Platforms
Windows Vista, Windows 7 and Windows Server 2008Target Platforms