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
BlobContinuationTokenA continuation token returned by a previous listing operation.
callback
AsyncCallbackAn AsyncCallback delegate that will receive notification when the asynchronous operation completes.
state
objectA 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
boolA boolean value that specifies whether to list blobs in a flat listing, or whether to list blobs hierarchically, by virtual directory.
blobListingDetails
BlobListingDetailsA 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
BlobContinuationTokenA continuation token returned by a previous listing operation.
options
BlobRequestOptionsA BlobRequestOptions object that specifies additional options for the request.
operationContext
OperationContextAn OperationContext object that represents the context for the current operation.
callback
AsyncCallbackAn AsyncCallback delegate that will receive notification when the asynchronous operation completes.
state
objectA 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
IAsyncResultAn 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
stringA 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
stringA 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
stringA string containing the name of the blob.
Returns
GetBlobReference(string, DateTimeOffset?)
Gets a reference to a blob in this virtual directory.
public virtual CloudBlob GetBlobReference(string blobName, DateTimeOffset? snapshotTime)
Parameters
blobName
stringA string containing the name of the blob.
snapshotTime
DateTimeOffset?A DateTimeOffset specifying the snapshot timestamp, if the blob is a snapshot.
Returns
GetBlockBlobReference(string)
Gets a reference to a block blob in this virtual directory.
public virtual CloudBlockBlob GetBlockBlobReference(string blobName)
Parameters
blobName
stringA 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
stringA 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
stringThe 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
stringA 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
stringThe 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
boolA boolean value that specifies whether to list blobs in a flat listing, or whether to list blobs hierarchically, by virtual directory.
blobListingDetails
BlobListingDetailsA BlobListingDetails enumeration describing which items to include in the listing.
options
BlobRequestOptionsA BlobRequestOptions object that specifies additional options for the request. If
null
, default options are applied to the request.operationContext
OperationContextAn 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
BlobContinuationTokenA 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
boolA boolean value that specifies whether to list blobs in a flat listing, or whether to list blobs hierarchically, by virtual directory.
blobListingDetails
BlobListingDetailsA 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
BlobContinuationTokenA continuation token returned by a previous listing operation.
options
BlobRequestOptionsA BlobRequestOptions object that specifies additional options for the request.
operationContext
OperationContextAn 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
BlobContinuationTokenA 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
BlobContinuationTokenA continuation token returned by a previous listing operation.
cancellationToken
CancellationTokenA 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
boolA boolean value that specifies whether to list blobs in a flat listing, or whether to list blobs hierarchically, by virtual directory.
blobListingDetails
BlobListingDetailsA 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
BlobContinuationTokenA continuation token returned by a previous listing operation.
options
BlobRequestOptionsA BlobRequestOptions object that specifies additional options for the request.
operationContext
OperationContextAn 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
boolA boolean value that specifies whether to list blobs in a flat listing, or whether to list blobs hierarchically, by virtual directory.
blobListingDetails
BlobListingDetailsA 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
BlobContinuationTokenA continuation token returned by a previous listing operation.
options
BlobRequestOptionsA BlobRequestOptions object that specifies additional options for the request.
operationContext
OperationContextAn OperationContext object that represents the context for the current operation.
cancellationToken
CancellationTokenA CancellationToken to observe while waiting for a task to complete.
Returns
- Task<BlobResultSegment>
A Task<TResult> object of type BlobResultSegment.