Class CloudFileDirectory
- Namespace
- Microsoft.WindowsAzure.Storage.File
- Assembly
- Microsoft.WindowsAzure.Storage.dll
Represents a directory of files, designated by a delimiter character.
public class CloudFileDirectory : IListFileItem
- Inheritance
-
CloudFileDirectory
- Implements
- Inherited Members
Remarks
Shares, which are encapsulated as CloudFileShare objects, hold directories, and directories hold files. Directories can also contain sub-directories.
Constructors
CloudFileDirectory(StorageUri, StorageCredentials)
Initializes a new instance of the CloudFileDirectory class using an absolute URI to the directory.
public CloudFileDirectory(StorageUri directoryAbsoluteUri, StorageCredentials credentials)
Parameters
directoryAbsoluteUri
StorageUriA System.Uri object containing the absolute URI to the directory.
credentials
StorageCredentialsA StorageCredentials object.
CloudFileDirectory(Uri)
Initializes a new instance of the CloudFileDirectory class using an absolute URI to the directory.
public CloudFileDirectory(Uri directoryAbsoluteUri)
Parameters
directoryAbsoluteUri
UriA System.Uri object containing the absolute URI to the directory.
CloudFileDirectory(Uri, StorageCredentials)
Initializes a new instance of the CloudFileDirectory class using an absolute URI to the directory.
public CloudFileDirectory(Uri directoryAbsoluteUri, StorageCredentials credentials)
Parameters
directoryAbsoluteUri
UriA System.Uri object containing the absolute URI to the directory.
credentials
StorageCredentialsA StorageCredentials object.
Properties
Metadata
Gets the user-defined metadata for the directory.
public IDictionary<string, string> Metadata { get; }
Property Value
- IDictionary<string, string>
The directory's metadata, as a collection of name-value pairs.
Name
Gets the name of the directory.
public string Name { get; }
Property Value
Parent
Gets a CloudFileDirectory object that represents the parent directory for the directory.
public CloudFileDirectory Parent { get; }
Property Value
- CloudFileDirectory
A CloudFileDirectory object.
Properties
Gets a FileDirectoryProperties object that represents the directory's system properties.
public FileDirectoryProperties Properties { get; }
Property Value
ServiceClient
Gets a CloudFileClient object that specifies the endpoint for the File service.
public CloudFileClient ServiceClient { get; }
Property Value
- CloudFileClient
A CloudFileClient object.
Share
Gets a CloudFileShare object that represents the share for the directory.
public CloudFileShare Share { get; }
Property Value
- CloudFileShare
A CloudFileShare object.
SnapshotQualifiedStorageUri
Gets the directory's URI for both the primary and secondary locations, including query string information if the directory's share is a snapshot.
public StorageUri SnapshotQualifiedStorageUri { get; }
Property Value
- StorageUri
An object of type StorageUri containing the directory's URIs for both the primary and secondary locations, including snapshot query information if the directory's share is a snapshot.
SnapshotQualifiedUri
Gets the absolute URI to the directory, including query string information if the directory's share is a snapshot.
public Uri SnapshotQualifiedUri { get; }
Property Value
- Uri
A System.Uri specifying the absolute URI to the directory, including snapshot query information if the directory's share is a snapshot.
StorageUri
Gets the file directory's URIs for all locations.
public StorageUri StorageUri { get; }
Property Value
- StorageUri
A StorageUri object containing the file directory's URIs for all locations.
Uri
Gets the directory's URI for the primary location.
public Uri Uri { get; }
Property Value
- Uri
A System.Uri specifying the absolute URI to the directory at the primary location.
Methods
BeginCreate(FileRequestOptions, OperationContext, AsyncCallback, object)
Begins an asynchronous operation to create a directory.
[DoesServiceRequest]
public virtual ICancellableAsyncResult BeginCreate(FileRequestOptions options, OperationContext operationContext, AsyncCallback callback, object state)
Parameters
options
FileRequestOptionsAn FileRequestOptions object that specifies additional options for the request.
operationContext
OperationContextAn OperationContext object that represents the context for the current operation.
callback
AsyncCallbackThe callback 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 IAsyncResult that references the asynchronous operation.
BeginCreate(AsyncCallback, object)
Begins an asynchronous operation to create a directory.
[DoesServiceRequest]
public virtual ICancellableAsyncResult BeginCreate(AsyncCallback callback, object state)
Parameters
callback
AsyncCallbackThe callback 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 IAsyncResult that references the asynchronous operation.
BeginCreateIfNotExists(FileRequestOptions, OperationContext, AsyncCallback, object)
Begins an asynchronous request to create the directory if it does not already exist.
[DoesServiceRequest]
public virtual ICancellableAsyncResult BeginCreateIfNotExists(FileRequestOptions options, OperationContext operationContext, AsyncCallback callback, object state)
Parameters
options
FileRequestOptionsAn FileRequestOptions object that specifies additional options for the request.
operationContext
OperationContextAn OperationContext object that represents the context for the current operation.
callback
AsyncCallbackThe callback 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 IAsyncResult that references the asynchronous operation.
Remarks
This API requires Create or Write permissions.
BeginCreateIfNotExists(AsyncCallback, object)
Begins an asynchronous request to create the directory if it does not already exist.
[DoesServiceRequest]
public virtual ICancellableAsyncResult BeginCreateIfNotExists(AsyncCallback callback, object state)
Parameters
callback
AsyncCallbackThe callback 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 IAsyncResult that references the asynchronous operation.
Remarks
This API requires Create or Write permissions.
BeginDelete(AccessCondition, FileRequestOptions, OperationContext, AsyncCallback, object)
Begins an asynchronous operation to delete a directory.
[DoesServiceRequest]
public virtual ICancellableAsyncResult BeginDelete(AccessCondition accessCondition, FileRequestOptions options, OperationContext operationContext, AsyncCallback callback, object state)
Parameters
accessCondition
AccessConditionAn AccessCondition object that represents the access conditions for the directory. If
null
, no condition is used.options
FileRequestOptionsAn FileRequestOptions object that specifies additional options for the request.
operationContext
OperationContextAn OperationContext object that represents the context for the current operation.
callback
AsyncCallbackThe callback 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 IAsyncResult that references the asynchronous operation.
BeginDelete(AsyncCallback, object)
Begins an asynchronous operation to delete a directory.
[DoesServiceRequest]
public virtual ICancellableAsyncResult BeginDelete(AsyncCallback callback, object state)
Parameters
callback
AsyncCallbackThe callback 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 IAsyncResult that references the asynchronous operation.
BeginDeleteIfExists(AccessCondition, FileRequestOptions, OperationContext, AsyncCallback, object)
Begins an asynchronous request to delete the directory if it already exists.
[DoesServiceRequest]
public virtual ICancellableAsyncResult BeginDeleteIfExists(AccessCondition accessCondition, FileRequestOptions options, OperationContext operationContext, AsyncCallback callback, object state)
Parameters
accessCondition
AccessConditionAn AccessCondition object that represents the access conditions for the directory. If
null
, no condition is used.options
FileRequestOptionsAn FileRequestOptions object that specifies additional options for the request.
operationContext
OperationContextAn OperationContext object that represents the context for the current operation.
callback
AsyncCallbackThe callback 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 IAsyncResult that references the asynchronous operation.
BeginDeleteIfExists(AsyncCallback, object)
Begins an asynchronous request to delete the directory if it already exists.
[DoesServiceRequest]
public virtual ICancellableAsyncResult BeginDeleteIfExists(AsyncCallback callback, object state)
Parameters
callback
AsyncCallbackThe callback 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 IAsyncResult that references the asynchronous operation.
BeginExists(FileRequestOptions, OperationContext, AsyncCallback, object)
Begins an asynchronous request to check whether the directory exists.
[DoesServiceRequest]
public virtual ICancellableAsyncResult BeginExists(FileRequestOptions options, OperationContext operationContext, AsyncCallback callback, object state)
Parameters
options
FileRequestOptionsAn FileRequestOptions object that specifies additional options for the request.
operationContext
OperationContextAn OperationContext object that represents the context for the current operation.
callback
AsyncCallbackThe callback 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 IAsyncResult that references the asynchronous operation.
BeginExists(AsyncCallback, object)
Begins an asynchronous request to check whether the directory exists.
[DoesServiceRequest]
public virtual ICancellableAsyncResult BeginExists(AsyncCallback callback, object state)
Parameters
callback
AsyncCallbackThe callback 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 IAsyncResult that references the asynchronous operation.
BeginFetchAttributes(AccessCondition, FileRequestOptions, OperationContext, AsyncCallback, object)
Begins an asynchronous operation to populate the directory's properties and metadata.
[DoesServiceRequest]
public virtual ICancellableAsyncResult BeginFetchAttributes(AccessCondition accessCondition, FileRequestOptions options, OperationContext operationContext, AsyncCallback callback, object state)
Parameters
accessCondition
AccessConditionAn AccessCondition object that represents the access conditions for the file. If
null
, no condition is used.options
FileRequestOptionsA FileRequestOptions object that specifies additional options for the request.
operationContext
OperationContextAn OperationContext object that represents the context for the current operation.
callback
AsyncCallbackThe callback 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.
BeginFetchAttributes(AsyncCallback, object)
Begins an asynchronous operation to populate the directory's properties.
[DoesServiceRequest]
public virtual ICancellableAsyncResult BeginFetchAttributes(AsyncCallback callback, object state)
Parameters
callback
AsyncCallbackThe callback 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.
BeginListFilesAndDirectoriesSegmented(FileContinuationToken, AsyncCallback, object)
Begins an asynchronous operation to return a result segment containing a collection of file items in the share.
[DoesServiceRequest]
public virtual ICancellableAsyncResult BeginListFilesAndDirectoriesSegmented(FileContinuationToken currentToken, AsyncCallback callback, object state)
Parameters
currentToken
FileContinuationTokenA continuation token returned by a previous listing operation.
callback
AsyncCallbackThe callback 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.
BeginListFilesAndDirectoriesSegmented(int?, FileContinuationToken, FileRequestOptions, OperationContext, AsyncCallback, object)
Begins an asynchronous operation to return a result segment containing a collection of file items in the share.
[DoesServiceRequest]
public virtual ICancellableAsyncResult BeginListFilesAndDirectoriesSegmented(int? maxResults, FileContinuationToken currentToken, FileRequestOptions options, OperationContext operationContext, AsyncCallback callback, object state)
Parameters
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
FileContinuationTokenA continuation token returned by a previous listing operation.
options
FileRequestOptionsAn FileRequestOptions object that specifies additional options for the request.
operationContext
OperationContextAn OperationContext object that represents the context for the current operation.
callback
AsyncCallbackThe callback 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.
BeginListFilesAndDirectoriesSegmented(string, int?, FileContinuationToken, FileRequestOptions, OperationContext, AsyncCallback, object)
Begins an asynchronous operation to return a result segment containing a collection of file items in the share.
[DoesServiceRequest]
public ICancellableAsyncResult BeginListFilesAndDirectoriesSegmented(string prefix, int? maxResults, FileContinuationToken currentToken, FileRequestOptions options, OperationContext operationContext, AsyncCallback callback, object state)
Parameters
prefix
stringA string containing the file or directory name prefix.
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
FileContinuationTokenA continuation token returned by a previous listing operation.
options
FileRequestOptionsAn FileRequestOptions object that specifies additional options for the request.
operationContext
OperationContextAn OperationContext object that represents the context for the current operation.
callback
AsyncCallbackThe callback 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.
BeginSetMetadata(AccessCondition, FileRequestOptions, OperationContext, AsyncCallback, object)
Begins an asynchronous operation to update the directory's metadata.
[DoesServiceRequest]
public virtual ICancellableAsyncResult BeginSetMetadata(AccessCondition accessCondition, FileRequestOptions options, OperationContext operationContext, AsyncCallback callback, object state)
Parameters
accessCondition
AccessConditionAn AccessCondition object that represents the access conditions for the directory. If
null
, no condition is used.options
FileRequestOptionsAn FileRequestOptions object that specifies additional options for the request.
operationContext
OperationContextAn OperationContext object that represents the context for the current operation.
callback
AsyncCallbackThe callback 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.
BeginSetMetadata(AsyncCallback, object)
Begins an asynchronous operation to update the directory's metadata.
[DoesServiceRequest]
public virtual ICancellableAsyncResult BeginSetMetadata(AsyncCallback callback, object state)
Parameters
callback
AsyncCallbackThe callback 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.
Create(FileRequestOptions, OperationContext)
Creates the directory.
[DoesServiceRequest]
public virtual void Create(FileRequestOptions requestOptions = null, OperationContext operationContext = null)
Parameters
requestOptions
FileRequestOptionsAn FileRequestOptions object that specifies additional options for the request.
operationContext
OperationContextAn OperationContext object that represents the context for the current operation. This object is used to track requests to the storage service, and to provide additional runtime information about the operation.
CreateAsync()
Returns a task that performs an asynchronous operation to create a directory.
[DoesServiceRequest]
public virtual Task CreateAsync()
Returns
CreateAsync(FileRequestOptions, OperationContext)
Returns a task that performs an asynchronous operation to create a directory.
[DoesServiceRequest]
public virtual Task CreateAsync(FileRequestOptions options, OperationContext operationContext)
Parameters
options
FileRequestOptionsA FileRequestOptions object that specifies additional options for the request.
operationContext
OperationContextAn OperationContext object that represents the context for the current operation.
Returns
CreateAsync(FileRequestOptions, OperationContext, CancellationToken)
Returns a task that performs an asynchronous operation to create a directory.
[DoesServiceRequest]
public virtual Task CreateAsync(FileRequestOptions options, OperationContext operationContext, CancellationToken cancellationToken)
Parameters
options
FileRequestOptionsA FileRequestOptions 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
CreateAsync(CancellationToken)
Returns a task that performs an asynchronous operation to create a directory.
[DoesServiceRequest]
public virtual Task CreateAsync(CancellationToken cancellationToken)
Parameters
cancellationToken
CancellationTokenA CancellationToken to observe while waiting for a task to complete.
Returns
CreateIfNotExists(FileRequestOptions, OperationContext)
Creates the directory if it does not already exist.
[DoesServiceRequest]
public virtual bool CreateIfNotExists(FileRequestOptions requestOptions = null, OperationContext operationContext = null)
Parameters
requestOptions
FileRequestOptionsAn FileRequestOptions object that specifies additional options for the request.
operationContext
OperationContextAn OperationContext object that represents the context for the current operation.
Returns
- bool
true
if the directory did not already exist and was created; otherwisefalse
.
Remarks
This API requires Create or Write permissions.
CreateIfNotExistsAsync()
Returns a task that performs an asynchronous request to create the directory if it does not already exist.
[DoesServiceRequest]
public virtual Task<bool> CreateIfNotExistsAsync()
Returns
- Task<bool>
A Task<TResult> object that represents the current operation.
Remarks
This API requires Create or Write permissions.
CreateIfNotExistsAsync(FileRequestOptions, OperationContext)
Returns a task that performs an asynchronous request to create the directory if it does not already exist.
[DoesServiceRequest]
public virtual Task<bool> CreateIfNotExistsAsync(FileRequestOptions options, OperationContext operationContext)
Parameters
options
FileRequestOptionsA FileRequestOptions object that specifies additional options for the request.
operationContext
OperationContextAn OperationContext object that represents the context for the current operation.
Returns
- Task<bool>
A Task<TResult> object that represents the current operation.
Remarks
This API requires Create or Write permissions.
CreateIfNotExistsAsync(FileRequestOptions, OperationContext, CancellationToken)
Returns a task that performs an asynchronous request to create the directory if it does not already exist.
[DoesServiceRequest]
public virtual Task<bool> CreateIfNotExistsAsync(FileRequestOptions options, OperationContext operationContext, CancellationToken cancellationToken)
Parameters
options
FileRequestOptionsA FileRequestOptions 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<bool>
A Task<TResult> object that represents the current operation.
Remarks
This API requires Create or Write permissions.
CreateIfNotExistsAsync(CancellationToken)
Returns a task that performs an asynchronous request to create the directory if it does not already exist.
[DoesServiceRequest]
public virtual Task<bool> CreateIfNotExistsAsync(CancellationToken cancellationToken)
Parameters
cancellationToken
CancellationTokenA CancellationToken to observe while waiting for a task to complete.
Returns
- Task<bool>
A Task<TResult> object that represents the current operation.
Remarks
This API requires Create or Write permissions.
Delete(AccessCondition, FileRequestOptions, OperationContext)
Deletes the directory.
[DoesServiceRequest]
public virtual void Delete(AccessCondition accessCondition = null, FileRequestOptions options = null, OperationContext operationContext = null)
Parameters
accessCondition
AccessConditionAn AccessCondition object that represents the access conditions for the directory. If
null
, no condition is used.options
FileRequestOptionsAn FileRequestOptions object that specifies additional options for the request.
operationContext
OperationContextAn OperationContext object that represents the context for the current operation.
DeleteAsync()
Returns a task that performs an asynchronous operation to delete a directory.
[DoesServiceRequest]
public virtual Task DeleteAsync()
Returns
DeleteAsync(AccessCondition, FileRequestOptions, OperationContext)
Returns a task that performs an asynchronous operation to delete a directory.
[DoesServiceRequest]
public virtual Task DeleteAsync(AccessCondition accessCondition, FileRequestOptions options, OperationContext operationContext)
Parameters
accessCondition
AccessConditionAn AccessCondition object that represents the access conditions for the directory. If
null
, no condition is used.options
FileRequestOptionsA FileRequestOptions object that specifies additional options for the request.
operationContext
OperationContextAn OperationContext object that represents the context for the current operation.
Returns
DeleteAsync(AccessCondition, FileRequestOptions, OperationContext, CancellationToken)
Returns a task that performs an asynchronous operation to delete a directory.
[DoesServiceRequest]
public virtual Task DeleteAsync(AccessCondition accessCondition, FileRequestOptions options, OperationContext operationContext, CancellationToken cancellationToken)
Parameters
accessCondition
AccessConditionAn AccessCondition object that represents the access conditions for the directory. If
null
, no condition is used.options
FileRequestOptionsA FileRequestOptions 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
DeleteAsync(CancellationToken)
Returns a task that performs an asynchronous operation to delete a directory.
[DoesServiceRequest]
public virtual Task DeleteAsync(CancellationToken cancellationToken)
Parameters
cancellationToken
CancellationTokenA CancellationToken to observe while waiting for a task to complete.
Returns
DeleteIfExists(AccessCondition, FileRequestOptions, OperationContext)
Deletes the directory if it already exists.
[DoesServiceRequest]
public virtual bool DeleteIfExists(AccessCondition accessCondition = null, FileRequestOptions options = null, OperationContext operationContext = null)
Parameters
accessCondition
AccessConditionAn AccessCondition object that represents the access conditions for the directory. If
null
, no condition is used.options
FileRequestOptionsAn FileRequestOptions object that specifies additional options for the request.
operationContext
OperationContextAn OperationContext object that represents the context for the current operation.
Returns
- bool
true
if the directory did already exist and was deleted; otherwisefalse
.
DeleteIfExistsAsync()
Returns a task that performs an asynchronous request to delete the directory if it already exists.
[DoesServiceRequest]
public virtual Task<bool> DeleteIfExistsAsync()
Returns
- Task<bool>
A Task<TResult> object that represents the current operation.
DeleteIfExistsAsync(AccessCondition, FileRequestOptions, OperationContext)
Returns a task that performs an asynchronous request to delete the directory if it already exists.
[DoesServiceRequest]
public virtual Task<bool> DeleteIfExistsAsync(AccessCondition accessCondition, FileRequestOptions options, OperationContext operationContext)
Parameters
accessCondition
AccessConditionAn AccessCondition object that represents the access conditions for the directory. If
null
, no condition is used.options
FileRequestOptionsA FileRequestOptions object that specifies additional options for the request.
operationContext
OperationContextAn OperationContext object that represents the context for the current operation.
Returns
- Task<bool>
A Task<TResult> object that represents the current operation.
DeleteIfExistsAsync(AccessCondition, FileRequestOptions, OperationContext, CancellationToken)
Returns a task that performs an asynchronous request to delete the directory if it already exists.
[DoesServiceRequest]
public virtual Task<bool> DeleteIfExistsAsync(AccessCondition accessCondition, FileRequestOptions options, OperationContext operationContext, CancellationToken cancellationToken)
Parameters
accessCondition
AccessConditionAn AccessCondition object that represents the access conditions for the directory. If
null
, no condition is used.options
FileRequestOptionsA FileRequestOptions 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<bool>
A Task<TResult> object that represents the current operation.
DeleteIfExistsAsync(CancellationToken)
Returns a task that performs an asynchronous request to delete the directory if it already exists.
[DoesServiceRequest]
public virtual Task<bool> DeleteIfExistsAsync(CancellationToken cancellationToken)
Parameters
cancellationToken
CancellationTokenA CancellationToken to observe while waiting for a task to complete.
Returns
- Task<bool>
A Task<TResult> object that represents the current operation.
EndCreate(IAsyncResult)
Ends an asynchronous operation to create a directory.
public virtual void EndCreate(IAsyncResult asyncResult)
Parameters
asyncResult
IAsyncResultAn IAsyncResult that references the pending asynchronous operation.
EndCreateIfNotExists(IAsyncResult)
Returns the result of an asynchronous request to create the directory if it does not already exist.
public virtual bool EndCreateIfNotExists(IAsyncResult asyncResult)
Parameters
asyncResult
IAsyncResultAn IAsyncResult that references the pending asynchronous operation.
Returns
- bool
true
if the directory did not already exist and was created; otherwise,false
.
EndDelete(IAsyncResult)
Ends an asynchronous operation to delete a directory.
public virtual void EndDelete(IAsyncResult asyncResult)
Parameters
asyncResult
IAsyncResultAn IAsyncResult that references the pending asynchronous operation.
EndDeleteIfExists(IAsyncResult)
Returns the result of an asynchronous request to delete the directory if it already exists.
public virtual bool EndDeleteIfExists(IAsyncResult asyncResult)
Parameters
asyncResult
IAsyncResultAn IAsyncResult that references the pending asynchronous operation.
Returns
- bool
true
if the directory did already exist and was deleted; otherwise,false
.
EndExists(IAsyncResult)
Returns the asynchronous result of the request to check whether the directory exists.
public virtual bool EndExists(IAsyncResult asyncResult)
Parameters
asyncResult
IAsyncResultAn IAsyncResult that references the pending asynchronous operation.
Returns
- bool
true
if the directory exists;false
, otherwise.
EndFetchAttributes(IAsyncResult)
Ends an asynchronous operation to populate the directory's properties and metadata.
public virtual void EndFetchAttributes(IAsyncResult asyncResult)
Parameters
asyncResult
IAsyncResultAn IAsyncResult that references the pending asynchronous operation.
EndListFilesAndDirectoriesSegmented(IAsyncResult)
Ends an asynchronous operation to return a result segment containing a collection of file items in the share.
public virtual FileResultSegment EndListFilesAndDirectoriesSegmented(IAsyncResult asyncResult)
Parameters
asyncResult
IAsyncResultAn IAsyncResult that references the pending asynchronous operation.
Returns
- FileResultSegment
A result segment containing objects that implement IListFileItem.
EndSetMetadata(IAsyncResult)
Ends an asynchronous operation to update the directory's metadata.
public virtual void EndSetMetadata(IAsyncResult asyncResult)
Parameters
asyncResult
IAsyncResultAn IAsyncResult that references the pending asynchronous operation.
Exists(FileRequestOptions, OperationContext)
Checks whether the directory exists.
[DoesServiceRequest]
public virtual bool Exists(FileRequestOptions requestOptions = null, OperationContext operationContext = null)
Parameters
requestOptions
FileRequestOptionsAn FileRequestOptions object that specifies additional options for the request.
operationContext
OperationContextAn OperationContext object that represents the context for the current operation.
Returns
- bool
true
if the directory exists;false
, otherwise.
ExistsAsync()
Returns a task that performs an asynchronous request to check whether the directory exists.
[DoesServiceRequest]
public virtual Task<bool> ExistsAsync()
Returns
- Task<bool>
A Task<TResult> object that represents the current operation.
ExistsAsync(FileRequestOptions, OperationContext)
Returns a task that performs an asynchronous request to check whether the directory exists.
[DoesServiceRequest]
public virtual Task<bool> ExistsAsync(FileRequestOptions options, OperationContext operationContext)
Parameters
options
FileRequestOptionsA FileRequestOptions object that specifies additional options for the request.
operationContext
OperationContextAn OperationContext object that represents the context for the current operation.
Returns
- Task<bool>
A Task<TResult> object that represents the current operation.
ExistsAsync(FileRequestOptions, OperationContext, CancellationToken)
Returns a task that performs an asynchronous request to check whether the directory exists.
[DoesServiceRequest]
public virtual Task<bool> ExistsAsync(FileRequestOptions options, OperationContext operationContext, CancellationToken cancellationToken)
Parameters
options
FileRequestOptionsA FileRequestOptions 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<bool>
A Task<TResult> object that represents the current operation.
ExistsAsync(CancellationToken)
Returns a task that performs an asynchronous request to check whether the directory exists.
[DoesServiceRequest]
public virtual Task<bool> ExistsAsync(CancellationToken cancellationToken)
Parameters
cancellationToken
CancellationTokenA CancellationToken to observe while waiting for a task to complete.
Returns
- Task<bool>
A Task<TResult> object that represents the current operation.
FetchAttributes(AccessCondition, FileRequestOptions, OperationContext)
Populates a directory's properties.
[DoesServiceRequest]
public virtual void FetchAttributes(AccessCondition accessCondition = null, FileRequestOptions options = null, OperationContext operationContext = null)
Parameters
accessCondition
AccessConditionAn AccessCondition object that represents the access conditions for the directory. If
null
, no condition is used.options
FileRequestOptionsA FileRequestOptions object that specifies additional options for the request.
operationContext
OperationContextAn OperationContext object that represents the context for the current operation.
FetchAttributesAsync()
Returns a task that performs an asynchronous operation to populate the directory's properties and metadata.
[DoesServiceRequest]
public virtual Task FetchAttributesAsync()
Returns
FetchAttributesAsync(AccessCondition, FileRequestOptions, OperationContext)
Returns a task that performs an asynchronous operation to populate the directory's properties and metadata.
[DoesServiceRequest]
public virtual Task FetchAttributesAsync(AccessCondition accessCondition, FileRequestOptions options, OperationContext operationContext)
Parameters
accessCondition
AccessConditionAn AccessCondition object that represents the access conditions for the file. If
null
, no condition is used.options
FileRequestOptionsA FileRequestOptions object that specifies additional options for the request.
operationContext
OperationContextAn OperationContext object that represents the context for the current operation.
Returns
FetchAttributesAsync(AccessCondition, FileRequestOptions, OperationContext, CancellationToken)
Returns a task that performs an asynchronous operation to populate the directory's properties and metadata.
[DoesServiceRequest]
public virtual Task FetchAttributesAsync(AccessCondition accessCondition, FileRequestOptions options, OperationContext operationContext, CancellationToken cancellationToken)
Parameters
accessCondition
AccessConditionAn AccessCondition object that represents the access conditions for the file. If
null
, no condition is used.options
FileRequestOptionsA FileRequestOptions 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
FetchAttributesAsync(CancellationToken)
Returns a task that performs an asynchronous operation to populate the directory's properties and metadata.
[DoesServiceRequest]
public virtual Task FetchAttributesAsync(CancellationToken cancellationToken)
Parameters
cancellationToken
CancellationTokenA CancellationToken to observe while waiting for a task to complete.
Returns
GetDirectoryReference(string)
Returns a CloudFileDirectory object that represents a subdirectory within this directory.
public virtual CloudFileDirectory GetDirectoryReference(string itemName)
Parameters
Returns
- CloudFileDirectory
A CloudFileDirectory object.
GetFileReference(string)
Returns a CloudFile object that represents a file in this directory.
public virtual CloudFile GetFileReference(string fileName)
Parameters
Returns
ListFilesAndDirectories(FileRequestOptions, OperationContext)
Returns an enumerable collection of the files in the share, which are retrieved lazily.
[DoesServiceRequest]
public virtual IEnumerable<IListFileItem> ListFilesAndDirectories(FileRequestOptions options = null, OperationContext operationContext = null)
Parameters
options
FileRequestOptionsAn FileRequestOptions object that specifies additional options for the request.
operationContext
OperationContextAn OperationContext object that represents the context for the current operation.
Returns
- IEnumerable<IListFileItem>
An enumerable collection of objects that implement IListFileItem and are retrieved lazily.
ListFilesAndDirectories(string, FileRequestOptions, OperationContext)
Returns an enumerable collection of the files in the share, which are retrieved lazily.
[DoesServiceRequest]
public IEnumerable<IListFileItem> ListFilesAndDirectories(string prefix, FileRequestOptions options = null, OperationContext operationContext = null)
Parameters
prefix
stringA string containing the file or directory name prefix.
options
FileRequestOptionsAn FileRequestOptions object that specifies additional options for the request.
operationContext
OperationContextAn OperationContext object that represents the context for the current operation.
Returns
- IEnumerable<IListFileItem>
An enumerable collection of objects that implement IListFileItem and are retrieved lazily.
ListFilesAndDirectoriesSegmented(FileContinuationToken)
Returns a result segment containing a collection of file items in the share.
[DoesServiceRequest]
public virtual FileResultSegment ListFilesAndDirectoriesSegmented(FileContinuationToken currentToken)
Parameters
currentToken
FileContinuationTokenA continuation token returned by a previous listing operation.
Returns
- FileResultSegment
A result segment containing objects that implement IListFileItem.
ListFilesAndDirectoriesSegmented(int?, FileContinuationToken, FileRequestOptions, OperationContext)
Returns a result segment containing a collection of file items in the share.
[DoesServiceRequest]
public virtual FileResultSegment ListFilesAndDirectoriesSegmented(int? maxResults, FileContinuationToken currentToken, FileRequestOptions options, OperationContext operationContext)
Parameters
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
FileContinuationTokenA continuation token returned by a previous listing operation.
options
FileRequestOptionsAn FileRequestOptions object that specifies additional options for the request.
operationContext
OperationContextAn OperationContext object that represents the context for the current operation.
Returns
- FileResultSegment
A result segment containing objects that implement IListFileItem.
ListFilesAndDirectoriesSegmented(string, int?, FileContinuationToken, FileRequestOptions, OperationContext)
Returns a result segment containing a collection of file items in the share.
[DoesServiceRequest]
public FileResultSegment ListFilesAndDirectoriesSegmented(string prefix, int? maxResults, FileContinuationToken currentToken, FileRequestOptions options, OperationContext operationContext)
Parameters
prefix
stringA string containing the file or directory name prefix.
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
FileContinuationTokenA continuation token returned by a previous listing operation.
options
FileRequestOptionsAn FileRequestOptions object that specifies additional options for the request.
operationContext
OperationContextAn OperationContext object that represents the context for the current operation.
Returns
- FileResultSegment
A result segment containing objects that implement IListFileItem.
ListFilesAndDirectoriesSegmentedAsync(FileContinuationToken)
Returns a task that performs an asynchronous operation to return a result segment containing a collection of file items in the share.
[DoesServiceRequest]
public virtual Task<FileResultSegment> ListFilesAndDirectoriesSegmentedAsync(FileContinuationToken currentToken)
Parameters
currentToken
FileContinuationTokenA continuation token returned by a previous listing operation.
Returns
- Task<FileResultSegment>
A Task<TResult> object that represents the current operation.
ListFilesAndDirectoriesSegmentedAsync(FileContinuationToken, CancellationToken)
Returns a task that performs an asynchronous operation to return a result segment containing a collection of file items in the share.
[DoesServiceRequest]
public virtual Task<FileResultSegment> ListFilesAndDirectoriesSegmentedAsync(FileContinuationToken currentToken, CancellationToken cancellationToken)
Parameters
currentToken
FileContinuationTokenA continuation token returned by a previous listing operation.
cancellationToken
CancellationTokenA CancellationToken to observe while waiting for a task to complete.
Returns
- Task<FileResultSegment>
A Task<TResult> object that represents the current operation.
ListFilesAndDirectoriesSegmentedAsync(int?, FileContinuationToken, FileRequestOptions, OperationContext)
Returns a task that performs an asynchronous operation to return a result segment containing a collection of file items in the share.
[DoesServiceRequest]
public virtual Task<FileResultSegment> ListFilesAndDirectoriesSegmentedAsync(int? maxResults, FileContinuationToken currentToken, FileRequestOptions options, OperationContext operationContext)
Parameters
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
FileContinuationTokenA continuation token returned by a previous listing operation.
options
FileRequestOptionsA FileRequestOptions object that specifies additional options for the request.
operationContext
OperationContextAn OperationContext object that represents the context for the current operation.
Returns
- Task<FileResultSegment>
A Task<TResult> object that represents the current operation.
ListFilesAndDirectoriesSegmentedAsync(int?, FileContinuationToken, FileRequestOptions, OperationContext, CancellationToken)
Returns a task that performs an asynchronous operation to return a result segment containing a collection of file items in the share.
[DoesServiceRequest]
public virtual Task<FileResultSegment> ListFilesAndDirectoriesSegmentedAsync(int? maxResults, FileContinuationToken currentToken, FileRequestOptions options, OperationContext operationContext, CancellationToken cancellationToken)
Parameters
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
FileContinuationTokenA continuation token returned by a previous listing operation.
options
FileRequestOptionsA FileRequestOptions 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<FileResultSegment>
A Task<TResult> object that represents the current operation.
ListFilesAndDirectoriesSegmentedAsync(string, FileContinuationToken, CancellationToken)
Returns a task that performs an asynchronous operation to return a result segment containing a collection of file items in the share.
[DoesServiceRequest]
public virtual Task<FileResultSegment> ListFilesAndDirectoriesSegmentedAsync(string prefix, FileContinuationToken currentToken, CancellationToken cancellationToken)
Parameters
prefix
stringA string containing the file or directory name prefix.
currentToken
FileContinuationTokenA continuation token returned by a previous listing operation.
cancellationToken
CancellationTokenA CancellationToken to observe while waiting for a task to complete.
Returns
- Task<FileResultSegment>
A Task<TResult> object that represents the current operation.
ListFilesAndDirectoriesSegmentedAsync(string, int?, FileContinuationToken, FileRequestOptions, OperationContext, CancellationToken)
Returns a task that performs an asynchronous operation to return a result segment containing a collection of file items in the share.
[DoesServiceRequest]
public virtual Task<FileResultSegment> ListFilesAndDirectoriesSegmentedAsync(string prefix, int? maxResults, FileContinuationToken currentToken, FileRequestOptions options, OperationContext operationContext, CancellationToken cancellationToken)
Parameters
prefix
stringA string containing the file or directory name prefix.
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
FileContinuationTokenA continuation token returned by a previous listing operation.
options
FileRequestOptionsA FileRequestOptions 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<FileResultSegment>
A Task<TResult> object that represents the current operation.
SetMetadata(AccessCondition, FileRequestOptions, OperationContext)
Updates the directory's metadata.
[DoesServiceRequest]
public virtual void SetMetadata(AccessCondition accessCondition = null, FileRequestOptions options = null, OperationContext operationContext = null)
Parameters
accessCondition
AccessConditionAn AccessCondition object that represents the access conditions for the directory. If
null
, no condition is used.options
FileRequestOptionsAn FileRequestOptions object that specifies additional options for the request.
operationContext
OperationContextAn OperationContext object that represents the context for the current operation.
SetMetadataAsync()
Returns a task that performs an asynchronous operation to update the directory's metadata.
[DoesServiceRequest]
public virtual Task SetMetadataAsync()
Returns
SetMetadataAsync(AccessCondition, FileRequestOptions, OperationContext)
Returns a task that performs an asynchronous operation to update the directory's metadata.
[DoesServiceRequest]
public virtual Task SetMetadataAsync(AccessCondition accessCondition, FileRequestOptions options, OperationContext operationContext)
Parameters
accessCondition
AccessConditionAn AccessCondition object that represents the access conditions for the directory. If
null
, no condition is used.options
FileRequestOptionsA FileRequestOptions object that specifies additional options for the request.
operationContext
OperationContextAn OperationContext object that represents the context for the current operation.
Returns
SetMetadataAsync(AccessCondition, FileRequestOptions, OperationContext, CancellationToken)
Returns a task that performs an asynchronous operation to update the directory's metadata.
[DoesServiceRequest]
public virtual Task SetMetadataAsync(AccessCondition accessCondition, FileRequestOptions options, OperationContext operationContext, CancellationToken cancellationToken)
Parameters
accessCondition
AccessConditionAn AccessCondition object that represents the access conditions for the directory. If
null
, no condition is used.options
FileRequestOptionsA FileRequestOptions 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
SetMetadataAsync(CancellationToken)
Returns a task that performs an asynchronous operation to update the directory's metadata.
[DoesServiceRequest]
public virtual Task SetMetadataAsync(CancellationToken cancellationToken)
Parameters
cancellationToken
CancellationTokenA CancellationToken to observe while waiting for a task to complete.