Table of Contents

Class CloudBlobDirectory

Namespace
Microsoft.WindowsAzure.Storage.Blob
Assembly
Microsoft.WindowsAzure.Storage.dll

Represents a virtual directory of blobs, designated by a delimiter character.

public class CloudBlobDirectory : IListBlobItem
Inheritance
CloudBlobDirectory
Implements
Inherited Members

Remarks

Containers, which are encapsulated as CloudBlobContainer objects, hold directories, and directories hold block blobs and page blobs. Directories can also contain sub-directories.

Properties

Container

Gets the container for the virtual directory.

public CloudBlobContainer Container { get; }

Property Value

CloudBlobContainer

A CloudBlobContainer object.

Parent

Gets the parent directory for the virtual directory.

public CloudBlobDirectory Parent { get; }

Property Value

CloudBlobDirectory

A CloudBlobDirectory object.

Prefix

Gets the prefix.

public string Prefix { get; }

Property Value

string

A string containing the prefix.

ServiceClient

Gets the Blob service client for the virtual directory.

public CloudBlobClient ServiceClient { get; }

Property Value

CloudBlobClient

A CloudBlobClient object.

StorageUri

Gets the blob directory's URIs for both the primary and secondary locations.

public StorageUri StorageUri { get; }

Property Value

StorageUri

An object of type StorageUri containing the blob directory's URIs for both the primary and secondary locations.

Uri

Gets the URI that identifies the virtual directory for the primary location.

public Uri Uri { get; }

Property Value

Uri

A System.Uri containing the URI to the virtual directory, at the primary location.

Methods

BeginListBlobsSegmented(BlobContinuationToken, AsyncCallback, object)

Begins an asynchronous operation to return a result segment containing a collection of blob items in the virtual directory.

[DoesServiceRequest]
public virtual ICancellableAsyncResult BeginListBlobsSegmented(BlobContinuationToken currentToken, AsyncCallback callback, object state)

Parameters

currentToken BlobContinuationToken

A continuation token returned by a previous listing operation.

callback AsyncCallback

An AsyncCallback delegate that will receive notification when the asynchronous operation completes.

state object

A user-defined object that will be passed to the callback delegate.

Returns

ICancellableAsyncResult

An ICancellableAsyncResult that references the asynchronous operation.

BeginListBlobsSegmented(bool, BlobListingDetails, int?, BlobContinuationToken, BlobRequestOptions, OperationContext, AsyncCallback, object)

Begins an asynchronous operation to return a result segment containing a collection of blob items in the virtual directory.

[DoesServiceRequest]
public virtual ICancellableAsyncResult BeginListBlobsSegmented(bool useFlatBlobListing, BlobListingDetails blobListingDetails, int? maxResults, BlobContinuationToken currentToken, BlobRequestOptions options, OperationContext operationContext, AsyncCallback callback, object state)

Parameters

useFlatBlobListing bool

A boolean value that specifies whether to list blobs in a flat listing, or whether to list blobs hierarchically, by virtual directory.

blobListingDetails BlobListingDetails

A BlobListingDetails enumeration describing which items to include in the listing.

maxResults int?

A non-negative integer value that indicates the maximum number of results to be returned at a time, up to the per-operation limit of 5000. If this value is null, the maximum possible number of results will be returned, up to 5000.

currentToken BlobContinuationToken

A continuation token returned by a previous listing operation.

options BlobRequestOptions

A BlobRequestOptions object that specifies additional options for the request.

operationContext OperationContext

An OperationContext object that represents the context for the current operation.

callback AsyncCallback

An AsyncCallback delegate that will receive notification when the asynchronous operation completes.

state object

A user-defined object that will be passed to the callback delegate.

Returns

ICancellableAsyncResult

An ICancellableAsyncResult that references the asynchronous operation.

EndListBlobsSegmented(IAsyncResult)

Ends an asynchronous operation to return a result segment containing a collection of blob items in the virtual directory.

public virtual BlobResultSegment EndListBlobsSegmented(IAsyncResult asyncResult)

Parameters

asyncResult IAsyncResult

An IAsyncResult that references the pending asynchronous operation.

Returns

BlobResultSegment

A BlobResultSegment object.

GetAppendBlobReference(string)

Gets a reference to an append blob in this virtual directory.

public virtual CloudAppendBlob GetAppendBlobReference(string blobName)

Parameters

blobName string

A string containing the name of the blob.

Returns

CloudAppendBlob

A CloudAppendBlob object.

GetAppendBlobReference(string, DateTimeOffset?)

Gets a reference to an append blob in this virtual directory.

public virtual CloudAppendBlob GetAppendBlobReference(string blobName, DateTimeOffset? snapshotTime)

Parameters

blobName string

A string containing the name of the blob.

snapshotTime DateTimeOffset?

A DateTimeOffset specifying the snapshot timestamp, if the blob is a snapshot.

Returns

CloudAppendBlob

A CloudAppendBlob object.

GetBlobReference(string)

Gets a reference to a blob in this virtual directory.

public virtual CloudBlob GetBlobReference(string blobName)

Parameters

blobName string

A string containing the name of the blob.

Returns

CloudBlob

A CloudBlob object.

GetBlobReference(string, DateTimeOffset?)

Gets a reference to a blob in this virtual directory.

public virtual CloudBlob GetBlobReference(string blobName, DateTimeOffset? snapshotTime)

Parameters

blobName string

A string containing the name of the blob.

snapshotTime DateTimeOffset?

A DateTimeOffset specifying the snapshot timestamp, if the blob is a snapshot.

Returns

CloudBlob

A CloudBlob object.

GetBlockBlobReference(string)

Gets a reference to a block blob in this virtual directory.

public virtual CloudBlockBlob GetBlockBlobReference(string blobName)

Parameters

blobName string

A string containing the name of the blob.

Returns

CloudBlockBlob

A CloudBlockBlob object.

GetBlockBlobReference(string, DateTimeOffset?)

Gets a reference to a block blob in this virtual directory.

public virtual CloudBlockBlob GetBlockBlobReference(string blobName, DateTimeOffset? snapshotTime)

Parameters

blobName string

A string containing the name of the blob.

snapshotTime DateTimeOffset?

A DateTimeOffset specifying the snapshot timestamp, if the blob is a snapshot.

Returns

CloudBlockBlob

A CloudBlockBlob object.

GetDirectoryReference(string)

Returns a virtual subdirectory within this virtual directory.

public virtual CloudBlobDirectory GetDirectoryReference(string itemName)

Parameters

itemName string

The name of the virtual subdirectory.

Returns

CloudBlobDirectory

A CloudBlobDirectory object representing the virtual subdirectory.

GetPageBlobReference(string)

Gets a reference to a page blob in this virtual directory.

public virtual CloudPageBlob GetPageBlobReference(string blobName)

Parameters

blobName string

A string containing the name of the blob.

Returns

CloudPageBlob

A CloudPageBlob object.

GetPageBlobReference(string, DateTimeOffset?)

Returns a reference to a page blob in this virtual directory.

public virtual CloudPageBlob GetPageBlobReference(string blobName, DateTimeOffset? snapshotTime)

Parameters

blobName string

The name of the page blob.

snapshotTime DateTimeOffset?

A DateTimeOffset specifying the snapshot timestamp, if the blob is a snapshot.

Returns

CloudPageBlob

A CloudPageBlob object.

ListBlobs(bool, BlobListingDetails, BlobRequestOptions, OperationContext)

Returns an enumerable collection of the blobs in the virtual directory that are retrieved lazily.

[DoesServiceRequest]
public virtual IEnumerable<IListBlobItem> ListBlobs(bool useFlatBlobListing = false, BlobListingDetails blobListingDetails = BlobListingDetails.None, BlobRequestOptions options = null, OperationContext operationContext = null)

Parameters

useFlatBlobListing bool

A boolean value that specifies whether to list blobs in a flat listing, or whether to list blobs hierarchically, by virtual directory.

blobListingDetails BlobListingDetails

A BlobListingDetails enumeration describing which items to include in the listing.

options BlobRequestOptions

A BlobRequestOptions object that specifies additional options for the request. If null, default options are applied to the request.

operationContext OperationContext

An OperationContext object that represents the context for the current operation.

Returns

IEnumerable<IListBlobItem>

An enumerable collection of objects that implement IListBlobItem and are retrieved lazily.

ListBlobsSegmented(BlobContinuationToken)

Returns a result segment containing a collection of blob items in the virtual directory.

[DoesServiceRequest]
public virtual BlobResultSegment ListBlobsSegmented(BlobContinuationToken currentToken)

Parameters

currentToken BlobContinuationToken

A BlobContinuationToken object returned by a previous listing operation.

Returns

BlobResultSegment

A BlobResultSegment object.

ListBlobsSegmented(bool, BlobListingDetails, int?, BlobContinuationToken, BlobRequestOptions, OperationContext)

Returns a result segment containing a collection of blob items in the virtual directory.

[DoesServiceRequest]
public virtual BlobResultSegment ListBlobsSegmented(bool useFlatBlobListing, BlobListingDetails blobListingDetails, int? maxResults, BlobContinuationToken currentToken, BlobRequestOptions options, OperationContext operationContext)

Parameters

useFlatBlobListing bool

A boolean value that specifies whether to list blobs in a flat listing, or whether to list blobs hierarchically, by virtual directory.

blobListingDetails BlobListingDetails

A BlobListingDetails enumeration describing which items to include in the listing.

maxResults int?

A non-negative integer value that indicates the maximum number of results to be returned at a time, up to the per-operation limit of 5000. If this value is null, the maximum possible number of results will be returned, up to 5000.

currentToken BlobContinuationToken

A continuation token returned by a previous listing operation.

options BlobRequestOptions

A BlobRequestOptions object that specifies additional options for the request.

operationContext OperationContext

An OperationContext object that represents the context for the current operation.

Returns

BlobResultSegment

A BlobResultSegment object.

ListBlobsSegmentedAsync(BlobContinuationToken)

Initiates an asynchronous operation to return a result segment containing a collection of blob items in the virtual directory.

[DoesServiceRequest]
public virtual Task<BlobResultSegment> ListBlobsSegmentedAsync(BlobContinuationToken currentToken)

Parameters

currentToken BlobContinuationToken

A continuation token returned by a previous listing operation.

Returns

Task<BlobResultSegment>

A Task<TResult> object of type BlobResultSegment.

ListBlobsSegmentedAsync(BlobContinuationToken, CancellationToken)

Initiates an asynchronous operation to return a result segment containing a collection of blob items in the virtual directory.

[DoesServiceRequest]
public virtual Task<BlobResultSegment> ListBlobsSegmentedAsync(BlobContinuationToken currentToken, CancellationToken cancellationToken)

Parameters

currentToken BlobContinuationToken

A continuation token returned by a previous listing operation.

cancellationToken CancellationToken

A CancellationToken to observe while waiting for a task to complete.

Returns

Task<BlobResultSegment>

A Task<TResult> object of type BlobResultSegment.

ListBlobsSegmentedAsync(bool, BlobListingDetails, int?, BlobContinuationToken, BlobRequestOptions, OperationContext)

Initiates an asynchronous operation to return a result segment containing a collection of blob items in the virtual directory.

[DoesServiceRequest]
public virtual Task<BlobResultSegment> ListBlobsSegmentedAsync(bool useFlatBlobListing, BlobListingDetails blobListingDetails, int? maxResults, BlobContinuationToken currentToken, BlobRequestOptions options, OperationContext operationContext)

Parameters

useFlatBlobListing bool

A boolean value that specifies whether to list blobs in a flat listing, or whether to list blobs hierarchically, by virtual directory.

blobListingDetails BlobListingDetails

A BlobListingDetails enumeration describing which items to include in the listing.

maxResults int?

A non-negative integer value that indicates the maximum number of results to be returned at a time, up to the per-operation limit of 5000. If this value is null, the maximum possible number of results will be returned, up to 5000.

currentToken BlobContinuationToken

A continuation token returned by a previous listing operation.

options BlobRequestOptions

A BlobRequestOptions object that specifies additional options for the request.

operationContext OperationContext

An OperationContext object that represents the context for the current operation.

Returns

Task<BlobResultSegment>

A Task<TResult> object of type BlobResultSegment.

ListBlobsSegmentedAsync(bool, BlobListingDetails, int?, BlobContinuationToken, BlobRequestOptions, OperationContext, CancellationToken)

Initiates an asynchronous operation to return a result segment containing a collection of blob items in the virtual directory.

[DoesServiceRequest]
public virtual Task<BlobResultSegment> ListBlobsSegmentedAsync(bool useFlatBlobListing, BlobListingDetails blobListingDetails, int? maxResults, BlobContinuationToken currentToken, BlobRequestOptions options, OperationContext operationContext, CancellationToken cancellationToken)

Parameters

useFlatBlobListing bool

A boolean value that specifies whether to list blobs in a flat listing, or whether to list blobs hierarchically, by virtual directory.

blobListingDetails BlobListingDetails

A BlobListingDetails enumeration describing which items to include in the listing.

maxResults int?

A non-negative integer value that indicates the maximum number of results to be returned at a time, up to the per-operation limit of 5000. If this value is null, the maximum possible number of results will be returned, up to 5000.

currentToken BlobContinuationToken

A continuation token returned by a previous listing operation.

options BlobRequestOptions

A BlobRequestOptions object that specifies additional options for the request.

operationContext OperationContext

An OperationContext object that represents the context for the current operation.

cancellationToken CancellationToken

A CancellationToken to observe while waiting for a task to complete.

Returns

Task<BlobResultSegment>

A Task<TResult> object of type BlobResultSegment.