Table of Contents

Class CloudFile

Namespace
Microsoft.WindowsAzure.Storage.File
Assembly
Microsoft.WindowsAzure.Storage.dll

Represents a file in the Microsoft Azure File service.

public class CloudFile : IListFileItem
Inheritance
CloudFile
Implements
Inherited Members

Constructors

CloudFile(StorageUri, StorageCredentials)

Initializes a new instance of the CloudFile class using an absolute URI to the file.

public CloudFile(StorageUri fileAbsoluteUri, StorageCredentials credentials)

Parameters

fileAbsoluteUri StorageUri

The absolute URI to the file.

credentials StorageCredentials

A StorageCredentials object.

CloudFile(Uri)

Initializes a new instance of the CloudFile class using an absolute URI to the file.

public CloudFile(Uri fileAbsoluteUri)

Parameters

fileAbsoluteUri Uri

The absolute URI to the file.

CloudFile(Uri, StorageCredentials)

Initializes a new instance of the CloudFile class using an absolute URI to the file.

public CloudFile(Uri fileAbsoluteUri, StorageCredentials credentials)

Parameters

fileAbsoluteUri Uri

The absolute URI to the file.

credentials StorageCredentials

A StorageCredentials object.

Properties

CopyState

Gets the state of the most recent or pending copy operation.

public CopyState CopyState { get; }

Property Value

CopyState

A CopyState object containing the copy state, or null if there is no copy state for the file.

Metadata

Gets the user-defined metadata for the file.

public IDictionary<string, string> Metadata { get; }

Property Value

IDictionary<string, string>

The file's metadata, as a collection of name-value pairs.

Name

Gets the file's name.

public virtual string Name { get; }

Property Value

string

The file's name.

Parent

Gets the CloudFileDirectory object representing the parent directory for the file.

public CloudFileDirectory Parent { get; }

Property Value

CloudFileDirectory

A CloudFileDirectory object.

Properties

Gets the file's system properties.

public FileProperties Properties { get; }

Property Value

FileProperties

A FileProperties object.

ServiceClient

Gets the CloudFileClient object that represents the File service.

public CloudFileClient ServiceClient { get; }

Property Value

CloudFileClient

A CloudFileClient object that specifies the File service endpoint.

Share

Gets a CloudFileShare object representing the file's share.

public CloudFileShare Share { get; }

Property Value

CloudFileShare

A CloudFileShare object.

SnapshotQualifiedStorageUri

Gets the file's URI for both the primary and secondary locations, including query string information if the file's share is a snapshot.

public StorageUri SnapshotQualifiedStorageUri { get; }

Property Value

StorageUri

An object of type StorageUri containing the file's URIs for both the primary and secondary locations, including snapshot query information if the file's share is a snapshot.

SnapshotQualifiedUri

Gets the absolute URI to the file, including query string information if the file's share is a snapshot.

public Uri SnapshotQualifiedUri { get; }

Property Value

Uri

A System.Uri specifying the absolute URI to the file, including snapshot query information if the file's share is a snapshot.

StorageUri

Gets the absolute URI to the file.

public StorageUri StorageUri { get; }

Property Value

StorageUri

A StorageUri object.

StreamMinimumReadSizeInBytes

Gets or sets the minimum number of bytes to buffer when reading from a file stream.

public int StreamMinimumReadSizeInBytes { get; set; }

Property Value

int

The minimum number of bytes to buffer, being at least 16KB.

StreamWriteSizeInBytes

Gets or sets the number of bytes to buffer when writing to a file stream.

public int StreamWriteSizeInBytes { get; set; }

Property Value

int

The number of bytes to buffer, ranging from between 512 bytes and 4 MB inclusive.

Uri

Gets the file's URI.

public Uri Uri { get; }

Property Value

Uri

The absolute URI to the file.

Methods

AbortCopy(string, AccessCondition, FileRequestOptions, OperationContext)

Aborts an ongoing copy operation.

[DoesServiceRequest]
public virtual void AbortCopy(string copyId, AccessCondition accessCondition = null, FileRequestOptions options = null, OperationContext operationContext = null)

Parameters

copyId string

A string identifying the copy operation.

accessCondition AccessCondition

An AccessCondition object that represents the condition that must be met in order for the request to proceed. If null, no condition is used.

options FileRequestOptions

A FileRequestOptions 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.

AbortCopyAsync(string)

Initiates an asynchronous operation to abort an ongoing copy operation.

[DoesServiceRequest]
public virtual Task AbortCopyAsync(string copyId)

Parameters

copyId string

A string identifying the copy operation.

Returns

Task

A Task object that represents the asynchronous operation.

AbortCopyAsync(string, AccessCondition, FileRequestOptions, OperationContext)

Initiates an asynchronous operation to abort an ongoing copy operation.

[DoesServiceRequest]
public virtual Task AbortCopyAsync(string copyId, AccessCondition accessCondition, FileRequestOptions options, OperationContext operationContext)

Parameters

copyId string

A string identifying the copy operation.

accessCondition AccessCondition

An AccessCondition object that represents the condition that must be met in order for the request to proceed. If null, no condition is used.

options FileRequestOptions

A FileRequestOptions object that specifies additional options for the request.

operationContext OperationContext

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

Returns

Task

A Task object that represents the asynchronous operation.

AbortCopyAsync(string, AccessCondition, FileRequestOptions, OperationContext, CancellationToken)

Initiates an asynchronous operation to abort an ongoing copy operation.

[DoesServiceRequest]
public virtual Task AbortCopyAsync(string copyId, AccessCondition accessCondition, FileRequestOptions options, OperationContext operationContext, CancellationToken cancellationToken)

Parameters

copyId string

A string identifying the copy operation.

accessCondition AccessCondition

An AccessCondition object that represents the condition that must be met in order for the request to proceed. If null, no condition is used.

options FileRequestOptions

A FileRequestOptions 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

A Task object that represents the asynchronous operation.

AbortCopyAsync(string, CancellationToken)

Initiates an asynchronous operation to abort an ongoing copy operation.

[DoesServiceRequest]
public virtual Task AbortCopyAsync(string copyId, CancellationToken cancellationToken)

Parameters

copyId string

A string identifying the copy operation.

cancellationToken CancellationToken

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

Returns

Task

A Task object that represents the asynchronous operation.

BeginAbortCopy(string, AccessCondition, FileRequestOptions, OperationContext, AsyncCallback, object)

Begins an asynchronous operation to abort an ongoing copy operation.

[DoesServiceRequest]
public virtual ICancellableAsyncResult BeginAbortCopy(string copyId, AccessCondition accessCondition, FileRequestOptions options, OperationContext operationContext, AsyncCallback callback, object state)

Parameters

copyId string

A string identifying the copy operation.

accessCondition AccessCondition

An AccessCondition object that represents the condition that must be met in order for the request to proceed. If null, no condition is used.

options FileRequestOptions

A FileRequestOptions 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.

BeginAbortCopy(string, AsyncCallback, object)

Begins an asynchronous operation to abort an ongoing copy operation.

[DoesServiceRequest]
public virtual ICancellableAsyncResult BeginAbortCopy(string copyId, AsyncCallback callback, object state)

Parameters

copyId string

A string identifying the copy 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.

BeginClearRange(long, long, AccessCondition, FileRequestOptions, OperationContext, AsyncCallback, object)

Begins an asynchronous operation to clear ranges from a file.

[DoesServiceRequest]
public virtual ICancellableAsyncResult BeginClearRange(long startOffset, long length, AccessCondition accessCondition, FileRequestOptions options, OperationContext operationContext, AsyncCallback callback, object state)

Parameters

startOffset long

The offset at which to begin clearing ranges, in bytes.

length long

The length of the data range to be cleared, in bytes.

accessCondition AccessCondition

An AccessCondition object that represents the access conditions for the file. If null, no condition is used.

options FileRequestOptions

An FileRequestOptions object that specifies additional options for the request.

operationContext OperationContext

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

callback AsyncCallback

The callback 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.

BeginClearRange(long, long, AsyncCallback, object)

Begins an asynchronous operation to clear ranges from a file.

[DoesServiceRequest]
public virtual ICancellableAsyncResult BeginClearRange(long startOffset, long length, AsyncCallback callback, object state)

Parameters

startOffset long

The offset at which to begin clearing ranges, in bytes.

length long

The length of the data range to be cleared, in bytes.

callback AsyncCallback

The callback 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.

BeginCreate(long, AccessCondition, FileRequestOptions, OperationContext, AsyncCallback, object)

Begins an asynchronous operation to create a file. If the file already exists, it will be overwritten.

[DoesServiceRequest]
public virtual ICancellableAsyncResult BeginCreate(long size, AccessCondition accessCondition, FileRequestOptions options, OperationContext operationContext, AsyncCallback callback, object state)

Parameters

size long

The maximum size of the file, in bytes.

accessCondition AccessCondition

An AccessCondition object that represents the access conditions for the file. If null, no condition is used.

options FileRequestOptions

A FileRequestOptions object that specifies additional options for the request.

operationContext OperationContext

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

callback AsyncCallback

The callback 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.

BeginCreate(long, AsyncCallback, object)

Begins an asynchronous operation to create a file. If the file already exists, it will be overwritten.

[DoesServiceRequest]
public virtual ICancellableAsyncResult BeginCreate(long size, AsyncCallback callback, object state)

Parameters

size long

The maximum size of the file, in bytes.

callback AsyncCallback

The callback 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.

BeginDelete(AccessCondition, FileRequestOptions, OperationContext, AsyncCallback, object)

Begins an asynchronous operation to delete the file.

[DoesServiceRequest]
public virtual ICancellableAsyncResult BeginDelete(AccessCondition accessCondition, FileRequestOptions options, OperationContext operationContext, AsyncCallback callback, object state)

Parameters

accessCondition AccessCondition

An AccessCondition object that represents the access conditions for the file. If null, no condition is used.

options FileRequestOptions

A FileRequestOptions object that specifies additional options for the request.

operationContext OperationContext

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

callback AsyncCallback

The callback 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.

BeginDelete(AsyncCallback, object)

Begins an asynchronous operation to delete the file.

[DoesServiceRequest]
public virtual ICancellableAsyncResult BeginDelete(AsyncCallback callback, object state)

Parameters

callback AsyncCallback

The callback 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.

BeginDeleteIfExists(AccessCondition, FileRequestOptions, OperationContext, AsyncCallback, object)

Begins an asynchronous request to delete the file if it already exists.

[DoesServiceRequest]
public virtual ICancellableAsyncResult BeginDeleteIfExists(AccessCondition accessCondition, FileRequestOptions options, OperationContext operationContext, AsyncCallback callback, object state)

Parameters

accessCondition AccessCondition

An AccessCondition object that represents the access conditions for the file. If null, no condition is used.

options FileRequestOptions

A FileRequestOptions object that specifies additional options for the request.

operationContext OperationContext

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

callback AsyncCallback

The callback 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.

BeginDeleteIfExists(AsyncCallback, object)

Begins an asynchronous request to delete the file if it already exists.

[DoesServiceRequest]
public virtual ICancellableAsyncResult BeginDeleteIfExists(AsyncCallback callback, object state)

Parameters

callback AsyncCallback

The callback 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.

BeginDownloadRangeToByteArray(byte[], int, long?, long?, AccessCondition, FileRequestOptions, OperationContext, AsyncCallback, object)

Begins an asynchronous operation to download the contents of a file to a byte array.

[DoesServiceRequest]
public virtual ICancellableAsyncResult BeginDownloadRangeToByteArray(byte[] target, int index, long? fileOffset, long? length, AccessCondition accessCondition, FileRequestOptions options, OperationContext operationContext, AsyncCallback callback, object state)

Parameters

target byte[]

The target byte array.

index int

The starting offset in the byte array.

fileOffset long?

The starting offset of the data range, in bytes.

length long?

The length of the data to download from the file, in bytes.

accessCondition AccessCondition

An AccessCondition object that represents the access conditions for the file.

options FileRequestOptions

A FileRequestOptions object that specifies additional options for the request.

operationContext OperationContext

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

callback AsyncCallback

The callback 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.

BeginDownloadRangeToByteArray(byte[], int, long?, long?, AsyncCallback, object)

Begins an asynchronous operation to download the contents of a file to a byte array.

[DoesServiceRequest]
public virtual ICancellableAsyncResult BeginDownloadRangeToByteArray(byte[] target, int index, long? fileOffset, long? length, AsyncCallback callback, object state)

Parameters

target byte[]

The target byte array.

index int

The starting offset in the byte array.

fileOffset long?

The starting offset of the data range, in bytes.

length long?

The length of the data to download from the file, in bytes.

callback AsyncCallback

The callback 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.

BeginDownloadRangeToStream(Stream, long?, long?, AccessCondition, FileRequestOptions, OperationContext, AsyncCallback, object)

Begins an asynchronous operation to download the contents of a file to a stream.

[DoesServiceRequest]
public virtual ICancellableAsyncResult BeginDownloadRangeToStream(Stream target, long? offset, long? length, AccessCondition accessCondition, FileRequestOptions options, OperationContext operationContext, AsyncCallback callback, object state)

Parameters

target Stream

The target stream.

offset long?

The starting offset of the data range, in bytes.

length long?

The length of the data range, in bytes.

accessCondition AccessCondition

An AccessCondition object that represents the access conditions for the file. If null, no condition is used.

options FileRequestOptions

A FileRequestOptions object that specifies additional options for the request.

operationContext OperationContext

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

callback AsyncCallback

The callback 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.

BeginDownloadRangeToStream(Stream, long?, long?, AsyncCallback, object)

Begins an asynchronous operation to download the contents of a file to a stream.

[DoesServiceRequest]
public virtual ICancellableAsyncResult BeginDownloadRangeToStream(Stream target, long? offset, long? length, AsyncCallback callback, object state)

Parameters

target Stream

The target stream.

offset long?

The starting offset of the data range, in bytes.

length long?

The length of the data range, in bytes.

callback AsyncCallback

The callback 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.

BeginDownloadText(AsyncCallback, object)

Begins an asynchronous operation to download the file's contents as a string.

[DoesServiceRequest]
public virtual ICancellableAsyncResult BeginDownloadText(AsyncCallback callback, object state)

Parameters

callback AsyncCallback

The callback 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.

BeginDownloadText(Encoding, AccessCondition, FileRequestOptions, OperationContext, AsyncCallback, object)

Begins an asynchronous operation to download the file's contents as a string.

[DoesServiceRequest]
public virtual ICancellableAsyncResult BeginDownloadText(Encoding encoding, AccessCondition accessCondition, FileRequestOptions options, OperationContext operationContext, AsyncCallback callback, object state)

Parameters

encoding Encoding

A Encoding object that indicates the type of text encoding to use.

accessCondition AccessCondition

An AccessCondition object that represents the access conditions for the file.

options FileRequestOptions

A FileRequestOptions object that specifies additional options for the request.

operationContext OperationContext

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

callback AsyncCallback

The callback 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.

BeginDownloadToByteArray(byte[], int, AccessCondition, FileRequestOptions, OperationContext, AsyncCallback, object)

Begins an asynchronous operation to download the contents of a file to a byte array.

[DoesServiceRequest]
public virtual ICancellableAsyncResult BeginDownloadToByteArray(byte[] target, int index, AccessCondition accessCondition, FileRequestOptions options, OperationContext operationContext, AsyncCallback callback, object state)

Parameters

target byte[]

The target byte array.

index int

The starting offset in the byte array.

accessCondition AccessCondition

An AccessCondition object that represents the access conditions for the file.

options FileRequestOptions

A FileRequestOptions object that specifies additional options for the request.

operationContext OperationContext

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

callback AsyncCallback

The callback 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.

BeginDownloadToByteArray(byte[], int, AsyncCallback, object)

Begins an asynchronous operation to download the contents of a file to a byte array.

[DoesServiceRequest]
public virtual ICancellableAsyncResult BeginDownloadToByteArray(byte[] target, int index, AsyncCallback callback, object state)

Parameters

target byte[]

The target byte array.

index int

The starting offset in the byte array.

callback AsyncCallback

The callback 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.

BeginDownloadToFile(string, FileMode, AccessCondition, FileRequestOptions, OperationContext, AsyncCallback, object)

Begins an asynchronous operation to download the contents of a file in the File service to a local file.

[DoesServiceRequest]
public virtual ICancellableAsyncResult BeginDownloadToFile(string path, FileMode mode, AccessCondition accessCondition, FileRequestOptions options, OperationContext operationContext, AsyncCallback callback, object state)

Parameters

path string

The path to the target file in the local file system.

mode FileMode

A FileMode enumeration value that determines how to open or create the file.

accessCondition AccessCondition

An AccessCondition object that represents the access conditions for the file.

options FileRequestOptions

A FileRequestOptions object that specifies additional options for the request.

operationContext OperationContext

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

callback AsyncCallback

The callback 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.

BeginDownloadToFile(string, FileMode, AsyncCallback, object)

Begins an asynchronous operation to download the contents of a file in the File service to a local file.

[DoesServiceRequest]
public virtual ICancellableAsyncResult BeginDownloadToFile(string path, FileMode mode, AsyncCallback callback, object state)

Parameters

path string

The path to the target file in the local file system.

mode FileMode

A FileMode enumeration value that determines how to open or create the file.

callback AsyncCallback

The callback 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.

BeginDownloadToStream(Stream, AccessCondition, FileRequestOptions, OperationContext, AsyncCallback, object)

Begins an asynchronous operation to download the contents of a file to a stream.

[DoesServiceRequest]
public virtual ICancellableAsyncResult BeginDownloadToStream(Stream target, AccessCondition accessCondition, FileRequestOptions options, OperationContext operationContext, AsyncCallback callback, object state)

Parameters

target Stream

The target stream.

accessCondition AccessCondition

An AccessCondition object that represents the access conditions for the file. If null, no condition is used.

options FileRequestOptions

A FileRequestOptions object that specifies additional options for the request.

operationContext OperationContext

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

callback AsyncCallback

The callback 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.

BeginDownloadToStream(Stream, AsyncCallback, object)

Begins an asynchronous operation to download the contents of a file to a stream.

[DoesServiceRequest]
public virtual ICancellableAsyncResult BeginDownloadToStream(Stream target, AsyncCallback callback, object state)

Parameters

target Stream

The target stream.

callback AsyncCallback

The callback 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.

BeginExists(FileRequestOptions, OperationContext, AsyncCallback, object)

Begins an asynchronous request to check existence of the file.

[DoesServiceRequest]
public virtual ICancellableAsyncResult BeginExists(FileRequestOptions options, OperationContext operationContext, AsyncCallback callback, object state)

Parameters

options FileRequestOptions

A FileRequestOptions object that specifies additional options for the request.

operationContext OperationContext

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

callback AsyncCallback

The callback 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.

BeginExists(AsyncCallback, object)

Begins an asynchronous request to check existence of the file.

[DoesServiceRequest]
public virtual ICancellableAsyncResult BeginExists(AsyncCallback callback, object state)

Parameters

callback AsyncCallback

The callback 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.

BeginFetchAttributes(AccessCondition, FileRequestOptions, OperationContext, AsyncCallback, object)

Begins an asynchronous operation to populate the file's properties and metadata.

[DoesServiceRequest]
public virtual ICancellableAsyncResult BeginFetchAttributes(AccessCondition accessCondition, FileRequestOptions options, OperationContext operationContext, AsyncCallback callback, object state)

Parameters

accessCondition AccessCondition

An AccessCondition object that represents the access conditions for the file. If null, no condition is used.

options FileRequestOptions

A FileRequestOptions object that specifies additional options for the request.

operationContext OperationContext

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

callback AsyncCallback

The callback 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.

BeginFetchAttributes(AsyncCallback, object)

Begins an asynchronous operation to populate the file's properties and metadata.

[DoesServiceRequest]
public virtual ICancellableAsyncResult BeginFetchAttributes(AsyncCallback callback, object state)

Parameters

callback AsyncCallback

The callback 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.

BeginListRanges(AsyncCallback, object)

Begins an asynchronous operation to return a collection of valid ranges and their starting and ending bytes.

[DoesServiceRequest]
public virtual ICancellableAsyncResult BeginListRanges(AsyncCallback callback, object state)

Parameters

callback AsyncCallback

The callback 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.

BeginListRanges(long?, long?, AccessCondition, FileRequestOptions, OperationContext, AsyncCallback, object)

Begins an asynchronous operation to return a collection of valid ranges and their starting and ending bytes.

[DoesServiceRequest]
public virtual ICancellableAsyncResult BeginListRanges(long? offset, long? length, AccessCondition accessCondition, FileRequestOptions options, OperationContext operationContext, AsyncCallback callback, object state)

Parameters

offset long?

The starting offset of the data range over which to list file ranges, in bytes.

length long?

The length of the data range over which to list file ranges, in bytes.

accessCondition AccessCondition

An AccessCondition object that represents the access conditions for the file. If null, no condition is used.

options FileRequestOptions

An FileRequestOptions object that specifies additional options for the request.

operationContext OperationContext

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

callback AsyncCallback

The callback 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.

BeginOpenRead(AccessCondition, FileRequestOptions, OperationContext, AsyncCallback, object)

Begins an asynchronous operation to open a stream for reading from the file.

[DoesServiceRequest]
public virtual ICancellableAsyncResult BeginOpenRead(AccessCondition accessCondition, FileRequestOptions options, OperationContext operationContext, AsyncCallback callback, object state)

Parameters

accessCondition AccessCondition

An AccessCondition object that represents the access conditions for the file. If null, no condition is used.

options FileRequestOptions

A FileRequestOptions object that specifies additional options for the request.

operationContext OperationContext

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

callback AsyncCallback

The callback 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.

BeginOpenRead(AsyncCallback, object)

Begins an asynchronous operation to open a stream for reading from the file.

[DoesServiceRequest]
public virtual ICancellableAsyncResult BeginOpenRead(AsyncCallback callback, object state)

Parameters

callback AsyncCallback

The callback 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.

BeginOpenWrite(long?, AccessCondition, FileRequestOptions, OperationContext, AsyncCallback, object)

Begins an asynchronous operation to open a stream for writing to the file. If the file already exists, then existing data in the file may be overwritten.

[DoesServiceRequest]
public virtual ICancellableAsyncResult BeginOpenWrite(long? size, AccessCondition accessCondition, FileRequestOptions options, OperationContext operationContext, AsyncCallback callback, object state)

Parameters

size long?

The size of the file to create, in bytes, or null. If null, the file must already exist. If not null, a new file of the given size will be created. If size is not null but the file already exists on the service, the already-existing file will be deleted.

accessCondition AccessCondition

An AccessCondition object that represents the access conditions for the file. If null, no condition is used.

options FileRequestOptions

A FileRequestOptions object that specifies additional options for the request.

operationContext OperationContext

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

callback AsyncCallback

The callback 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.

BeginOpenWrite(long?, AsyncCallback, object)

Begins an asynchronous operation to open a stream for writing to the file. If the file already exists, then existing data in the file may be overwritten.

[DoesServiceRequest]
public virtual ICancellableAsyncResult BeginOpenWrite(long? size, AsyncCallback callback, object state)

Parameters

size long?

The size of the file to create, in bytes, or null. If null, the file must already exist. If not null, a new file of the given size will be created. If size is not null but the file already exists on the service, the already-existing file will be deleted.

callback AsyncCallback

The callback 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.

BeginResize(long, AccessCondition, FileRequestOptions, OperationContext, AsyncCallback, object)

Begins an asynchronous operation to resize a file.

[DoesServiceRequest]
public virtual ICancellableAsyncResult BeginResize(long size, AccessCondition accessCondition, FileRequestOptions options, OperationContext operationContext, AsyncCallback callback, object state)

Parameters

size long

The maximum size of the file, in bytes.

accessCondition AccessCondition

An AccessCondition object that represents the access conditions for the file. If null, no condition is used.

options FileRequestOptions

An FileRequestOptions object that specifies additional options for the request.

operationContext OperationContext

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

callback AsyncCallback

The callback 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.

BeginResize(long, AsyncCallback, object)

Begins an asynchronous operation to resize a file.

[DoesServiceRequest]
public virtual ICancellableAsyncResult BeginResize(long size, AsyncCallback callback, object state)

Parameters

size long

The maximum size of the file, in bytes.

callback AsyncCallback

The callback 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.

BeginSetMetadata(AccessCondition, FileRequestOptions, OperationContext, AsyncCallback, object)

Begins an asynchronous operation to update the file's metadata.

[DoesServiceRequest]
public virtual ICancellableAsyncResult BeginSetMetadata(AccessCondition accessCondition, FileRequestOptions options, OperationContext operationContext, AsyncCallback callback, object state)

Parameters

accessCondition AccessCondition

An AccessCondition object that represents the access conditions for the file. If null, no condition is used.

options FileRequestOptions

An FileRequestOptions object that specifies additional options for the request.

operationContext OperationContext

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

callback AsyncCallback

The callback 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.

BeginSetMetadata(AsyncCallback, object)

Begins an asynchronous operation to update the file's metadata.

[DoesServiceRequest]
public virtual ICancellableAsyncResult BeginSetMetadata(AsyncCallback callback, object state)

Parameters

callback AsyncCallback

The callback 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.

BeginSetProperties(AccessCondition, FileRequestOptions, OperationContext, AsyncCallback, object)

Begins an asynchronous operation to update the file's properties.

[DoesServiceRequest]
public virtual ICancellableAsyncResult BeginSetProperties(AccessCondition accessCondition, FileRequestOptions options, OperationContext operationContext, AsyncCallback callback, object state)

Parameters

accessCondition AccessCondition

An AccessCondition object that represents the access conditions for the file. If null, no condition is used.

options FileRequestOptions

An FileRequestOptions object that specifies additional options for the request.

operationContext OperationContext

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

callback AsyncCallback

The callback 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.

BeginSetProperties(AsyncCallback, object)

Begins an asynchronous operation to update the file's properties.

[DoesServiceRequest]
public virtual ICancellableAsyncResult BeginSetProperties(AsyncCallback callback, object state)

Parameters

callback AsyncCallback

The callback 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.

BeginStartCopy(CloudBlob, AccessCondition, AccessCondition, FileRequestOptions, OperationContext, AsyncCallback, object)

Begins an asynchronous operation to start copying a blob's contents, properties, and metadata to this Azure file.

[DoesServiceRequest]
public virtual ICancellableAsyncResult BeginStartCopy(CloudBlob source, AccessCondition sourceAccessCondition, AccessCondition destAccessCondition, FileRequestOptions options, OperationContext operationContext, AsyncCallback callback, object state)

Parameters

source CloudBlob

The CloudBlob that is the source blob.

sourceAccessCondition AccessCondition

An AccessCondition object that represents the access conditions for the source blob. If null, no condition is used.

destAccessCondition AccessCondition

An AccessCondition object that represents the access conditions for the destination file. If null, no condition is used.

options FileRequestOptions

A FileRequestOptions 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.

BeginStartCopy(CloudBlob, AsyncCallback, object)

Begins an asynchronous operation to start copying a blob's contents, properties, and metadata to this Azure file.

[DoesServiceRequest]
public virtual ICancellableAsyncResult BeginStartCopy(CloudBlob source, AsyncCallback callback, object state)

Parameters

source CloudBlob

The CloudBlob that is the source blob.

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.

BeginStartCopy(CloudFile, AccessCondition, AccessCondition, FileRequestOptions, OperationContext, AsyncCallback, object)

Begins an asynchronous operation to start copying another file's contents, properties, and metadata to this file.

[DoesServiceRequest]
public virtual ICancellableAsyncResult BeginStartCopy(CloudFile source, AccessCondition sourceAccessCondition, AccessCondition destAccessCondition, FileRequestOptions options, OperationContext operationContext, AsyncCallback callback, object state)

Parameters

source CloudFile

A CloudFile object.

sourceAccessCondition AccessCondition

An AccessCondition object that represents the access conditions for the source file. If null, no condition is used.

destAccessCondition AccessCondition

An AccessCondition object that represents the access conditions for the destination file. If null, no condition is used.

options FileRequestOptions

A FileRequestOptions 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.

BeginStartCopy(CloudFile, AsyncCallback, object)

Begins an asynchronous operation to start copying another file's contents, properties, and metadata to this file.

[DoesServiceRequest]
public virtual ICancellableAsyncResult BeginStartCopy(CloudFile source, AsyncCallback callback, object state)

Parameters

source CloudFile

A CloudFile object.

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.

BeginStartCopy(Uri, AccessCondition, AccessCondition, FileRequestOptions, OperationContext, AsyncCallback, object)

Begins an asynchronous operation to start copying another Azure file or blob's contents, properties, and metadata to this Azure file.

[DoesServiceRequest]
public virtual ICancellableAsyncResult BeginStartCopy(Uri source, AccessCondition sourceAccessCondition, AccessCondition destAccessCondition, FileRequestOptions options, OperationContext operationContext, AsyncCallback callback, object state)

Parameters

source Uri

The System.Uri of the source blob or file.

sourceAccessCondition AccessCondition

An AccessCondition object that represents the access conditions for the source object. If null, no condition is used.

destAccessCondition AccessCondition

An AccessCondition object that represents the access conditions for the destination file. If null, no condition is used.

options FileRequestOptions

A FileRequestOptions 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.

BeginStartCopy(Uri, AsyncCallback, object)

Begins an asynchronous operation to start copying another Azure file or blob's contents, properties, and metadata to this Azure file.

[DoesServiceRequest]
public virtual ICancellableAsyncResult BeginStartCopy(Uri source, AsyncCallback callback, object state)

Parameters

source Uri

The System.Uri of the source blob or file.

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.

BeginUploadFromByteArray(byte[], int, int, AccessCondition, FileRequestOptions, OperationContext, AsyncCallback, object)

Begins an asynchronous operation to upload the contents of a byte array to a file. If the file already exists on the service, it will be overwritten.

[DoesServiceRequest]
public virtual ICancellableAsyncResult BeginUploadFromByteArray(byte[] buffer, int index, int count, AccessCondition accessCondition, FileRequestOptions options, OperationContext operationContext, AsyncCallback callback, object state)

Parameters

buffer byte[]

An array of bytes.

index int

The zero-based byte offset in buffer at which to begin uploading bytes to the file.

count int

The number of bytes to be written to the file.

accessCondition AccessCondition

An AccessCondition object that represents the access conditions for the file.

options FileRequestOptions

A FileRequestOptions object that specifies additional options for the request.

operationContext OperationContext

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

callback AsyncCallback

The callback 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.

BeginUploadFromByteArray(byte[], int, int, AsyncCallback, object)

Begins an asynchronous operation to upload the contents of a byte array to a file. If the file already exists on the service, it will be overwritten.

[DoesServiceRequest]
public virtual ICancellableAsyncResult BeginUploadFromByteArray(byte[] buffer, int index, int count, AsyncCallback callback, object state)

Parameters

buffer byte[]

An array of bytes.

index int

The zero-based byte offset in buffer at which to begin uploading bytes to the file.

count int

The number of bytes to be written to the file.

callback AsyncCallback

The callback 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.

BeginUploadFromFile(string, AccessCondition, FileRequestOptions, OperationContext, AsyncCallback, object)

Begins an asynchronous operation to upload a file to the File service. If the file already exists on the service, it will be overwritten.

[DoesServiceRequest]
public virtual ICancellableAsyncResult BeginUploadFromFile(string path, AccessCondition accessCondition, FileRequestOptions options, OperationContext operationContext, AsyncCallback callback, object state)

Parameters

path string

The file providing the content.

accessCondition AccessCondition

An AccessCondition object that represents the access conditions for the file.

options FileRequestOptions

A FileRequestOptions object that specifies additional options for the request.

operationContext OperationContext

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

callback AsyncCallback

The callback 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.

BeginUploadFromFile(string, AsyncCallback, object)

Begins an asynchronous operation to upload a file to the File service. If the file already exists on the service, it will be overwritten.

[DoesServiceRequest]
public virtual ICancellableAsyncResult BeginUploadFromFile(string path, AsyncCallback callback, object state)

Parameters

path string

The file providing the content.

callback AsyncCallback

The callback 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.

BeginUploadFromStream(Stream, AccessCondition, FileRequestOptions, OperationContext, AsyncCallback, object)

Begins an asynchronous operation to upload a stream to a file. If the file already exists on the service, it will be overwritten.

[DoesServiceRequest]
public virtual ICancellableAsyncResult BeginUploadFromStream(Stream source, AccessCondition accessCondition, FileRequestOptions options, OperationContext operationContext, AsyncCallback callback, object state)

Parameters

source Stream

The stream providing the file content.

accessCondition AccessCondition

An AccessCondition object that represents the access conditions for the file. If null, no condition is used.

options FileRequestOptions

A FileRequestOptions object that specifies additional options for the request.

operationContext OperationContext

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

callback AsyncCallback

The callback 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.

BeginUploadFromStream(Stream, AsyncCallback, object)

Begins an asynchronous operation to upload a stream to a file. If the file already exists on the service, it will be overwritten.

[DoesServiceRequest]
public virtual ICancellableAsyncResult BeginUploadFromStream(Stream source, AsyncCallback callback, object state)

Parameters

source Stream

The stream providing the file content.

callback AsyncCallback

The callback 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.

BeginUploadFromStream(Stream, long, AccessCondition, FileRequestOptions, OperationContext, AsyncCallback, object)

Begins an asynchronous operation to upload a stream to a file. If the file already exists on the service, it will be overwritten.

[DoesServiceRequest]
public virtual ICancellableAsyncResult BeginUploadFromStream(Stream source, long length, AccessCondition accessCondition, FileRequestOptions options, OperationContext operationContext, AsyncCallback callback, object state)

Parameters

source Stream

The stream providing the file content.

length long

Specifies the number of bytes from the Stream source to upload from the start position.

accessCondition AccessCondition

An AccessCondition object that represents the access conditions for the file. If null, no condition is used.

options FileRequestOptions

A FileRequestOptions object that specifies additional options for the request.

operationContext OperationContext

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

callback AsyncCallback

The callback 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.

BeginUploadFromStream(Stream, long, AsyncCallback, object)

Begins an asynchronous operation to upload a stream to a file. If the file already exists on the service, it will be overwritten.

[DoesServiceRequest]
public virtual ICancellableAsyncResult BeginUploadFromStream(Stream source, long length, AsyncCallback callback, object state)

Parameters

source Stream

The stream providing the file content.

length long

Specifies the number of bytes from the Stream source to upload from the start position.

callback AsyncCallback

The callback 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.

BeginUploadText(string, AsyncCallback, object)

Begins an asynchronous operation to upload a string of text to a file. If the file already exists on the service, it will be overwritten.

[DoesServiceRequest]
public virtual ICancellableAsyncResult BeginUploadText(string content, AsyncCallback callback, object state)

Parameters

content string

The text to upload.

callback AsyncCallback

The callback 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.

BeginUploadText(string, Encoding, AccessCondition, FileRequestOptions, OperationContext, AsyncCallback, object)

Begins an asynchronous operation to upload a string of text to a file. If the file already exists on the service, it will be overwritten.

[DoesServiceRequest]
public virtual ICancellableAsyncResult BeginUploadText(string content, Encoding encoding, AccessCondition accessCondition, FileRequestOptions options, OperationContext operationContext, AsyncCallback callback, object state)

Parameters

content string

The text to upload.

encoding Encoding

An object that indicates the text encoding to use. If null, UTF-8 will be used.

accessCondition AccessCondition

An AccessCondition object that represents the access conditions for the file.

options FileRequestOptions

A FileRequestOptions object that specifies additional options for the request.

operationContext OperationContext

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

callback AsyncCallback

The callback 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.

BeginWriteRange(Stream, long, string, AccessCondition, FileRequestOptions, OperationContext, AsyncCallback, object)

Begins an asynchronous operation to write a range to a file.

[DoesServiceRequest]
public virtual ICancellableAsyncResult BeginWriteRange(Stream rangeData, long startOffset, string contentMD5, AccessCondition accessCondition, FileRequestOptions options, OperationContext operationContext, AsyncCallback callback, object state)

Parameters

rangeData Stream

A stream providing the data.

startOffset long

The offset at which to begin writing, in bytes.

contentMD5 string

An optional hash value that will be used to set the ContentMD5 property on the file. May be null or an empty string.

accessCondition AccessCondition

An AccessCondition object that represents the access conditions for the file. If null, no condition is used.

options FileRequestOptions

A FileRequestOptions object that specifies additional options for the request.

operationContext OperationContext

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

callback AsyncCallback

The callback 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.

BeginWriteRange(Stream, long, string, AsyncCallback, object)

Begins an asynchronous operation to write a range to a file.

[DoesServiceRequest]
public virtual ICancellableAsyncResult BeginWriteRange(Stream rangeData, long startOffset, string contentMD5, AsyncCallback callback, object state)

Parameters

rangeData Stream

A stream providing the data.

startOffset long

The offset at which to begin writing, in bytes.

contentMD5 string

An optional hash value that will be used to set the ContentMD5 property on the file. May be null or an empty string.

callback AsyncCallback

The callback 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.

ClearRange(long, long, AccessCondition, FileRequestOptions, OperationContext)

Clears ranges from a file.

[DoesServiceRequest]
public virtual void ClearRange(long startOffset, long length, AccessCondition accessCondition = null, FileRequestOptions options = null, OperationContext operationContext = null)

Parameters

startOffset long

The offset at which to begin clearing ranges, in bytes.

length long

The length of the range to be cleared, in bytes.

accessCondition AccessCondition

An AccessCondition object that represents the access conditions for the file. If null, no condition is used.

options FileRequestOptions

An FileRequestOptions object that specifies additional options for the request.

operationContext OperationContext

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

ClearRangeAsync(long, long)

Returns a task that performs an asynchronous operation to clear ranges from a file.

[DoesServiceRequest]
public virtual Task ClearRangeAsync(long startOffset, long length)

Parameters

startOffset long

The offset at which to begin clearing ranges, in bytes.

length long

The length of the data range to be cleared, in bytes.

Returns

Task

A Task object that represents the current operation.

ClearRangeAsync(long, long, AccessCondition, FileRequestOptions, OperationContext)

Returns a task that performs an asynchronous operation to clear ranges from a file.

[DoesServiceRequest]
public virtual Task ClearRangeAsync(long startOffset, long length, AccessCondition accessCondition, FileRequestOptions options, OperationContext operationContext)

Parameters

startOffset long

The offset at which to begin clearing ranges, in bytes.

length long

The length of the data range to be cleared, in bytes.

accessCondition AccessCondition

An AccessCondition object that represents the access conditions for the file. If null, no condition is used.

options FileRequestOptions

A FileRequestOptions object that specifies additional options for the request.

operationContext OperationContext

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

Returns

Task

A Task object that represents the current operation.

ClearRangeAsync(long, long, AccessCondition, FileRequestOptions, OperationContext, CancellationToken)

Returns a task that performs an asynchronous operation to clear ranges from a file.

[DoesServiceRequest]
public virtual Task ClearRangeAsync(long startOffset, long length, AccessCondition accessCondition, FileRequestOptions options, OperationContext operationContext, CancellationToken cancellationToken)

Parameters

startOffset long

The offset at which to begin clearing ranges, in bytes.

length long

The length of the data range to be cleared, in bytes.

accessCondition AccessCondition

An AccessCondition object that represents the access conditions for the file. If null, no condition is used.

options FileRequestOptions

A FileRequestOptions 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

A Task object that represents the current operation.

ClearRangeAsync(long, long, CancellationToken)

Returns a task that performs an asynchronous operation to clear ranges from a file.

[DoesServiceRequest]
public virtual Task ClearRangeAsync(long startOffset, long length, CancellationToken cancellationToken)

Parameters

startOffset long

The offset at which to begin clearing ranges, in bytes.

length long

The length of the data range to be cleared, in bytes.

cancellationToken CancellationToken

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

Returns

Task

A Task object that represents the current operation.

Create(long, AccessCondition, FileRequestOptions, OperationContext)

Creates a file. If the file already exists, it will be overwritten.3584

[DoesServiceRequest]
public virtual void Create(long size, AccessCondition accessCondition = null, FileRequestOptions options = null, OperationContext operationContext = null)

Parameters

size long

The maximum size of the file, in bytes.

accessCondition AccessCondition

An AccessCondition object that represents the access conditions for the file. If null, no condition is used.

options FileRequestOptions

A FileRequestOptions object that specifies additional options for the request.

operationContext OperationContext

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

CreateAsync(long)

Returns a task that performs an asynchronous operation to create a file. If the file already exists, it will be overwritten.

[DoesServiceRequest]
public virtual Task CreateAsync(long size)

Parameters

size long

The maximum size of the file, in bytes.

Returns

Task

A Task object that represents the current operation.

CreateAsync(long, AccessCondition, FileRequestOptions, OperationContext)

Returns a task that performs an asynchronous operation to create a file. If the file already exists, it will be overwritten.

[DoesServiceRequest]
public virtual Task CreateAsync(long size, AccessCondition accessCondition, FileRequestOptions options, OperationContext operationContext)

Parameters

size long

The maximum size of the file, in bytes.

accessCondition AccessCondition

An AccessCondition object that represents the access conditions for the file. If null, no condition is used.

options FileRequestOptions

A FileRequestOptions object that specifies additional options for the request.

operationContext OperationContext

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

Returns

Task

A Task object that represents the current operation.

CreateAsync(long, AccessCondition, FileRequestOptions, OperationContext, CancellationToken)

Returns a task that performs an asynchronous operation to create a file. If the file already exists, it will be overwritten.

[DoesServiceRequest]
public virtual Task CreateAsync(long size, AccessCondition accessCondition, FileRequestOptions options, OperationContext operationContext, CancellationToken cancellationToken)

Parameters

size long

The maximum size of the file, in bytes.

accessCondition AccessCondition

An AccessCondition object that represents the access conditions for the file. If null, no condition is used.

options FileRequestOptions

A FileRequestOptions 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

A Task object that represents the current operation.

CreateAsync(long, CancellationToken)

Returns a task that performs an asynchronous operation to create a file. If the file already exists, it will be overwritten.

[DoesServiceRequest]
public virtual Task CreateAsync(long size, CancellationToken cancellationToken)

Parameters

size long

The maximum size of the file, in bytes.

cancellationToken CancellationToken

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

Returns

Task

A Task object that represents the current operation.

Delete(AccessCondition, FileRequestOptions, OperationContext)

Deletes the file.

[DoesServiceRequest]
public virtual void Delete(AccessCondition accessCondition = null, FileRequestOptions options = null, OperationContext operationContext = null)

Parameters

accessCondition AccessCondition

An AccessCondition object that represents the access conditions for the file. If null, no condition is used.

options FileRequestOptions

A FileRequestOptions object that specifies additional options for the request.

operationContext OperationContext

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

DeleteAsync()

Returns a task that performs an asynchronous operation to delete the file.

[DoesServiceRequest]
public virtual Task DeleteAsync()

Returns

Task

A Task object that represents the current operation.

DeleteAsync(AccessCondition, FileRequestOptions, OperationContext)

Returns a task that performs an asynchronous operation to delete the file.

[DoesServiceRequest]
public virtual Task DeleteAsync(AccessCondition accessCondition, FileRequestOptions options, OperationContext operationContext)

Parameters

accessCondition AccessCondition

An AccessCondition object that represents the access conditions for the file. If null, no condition is used.

options FileRequestOptions

A FileRequestOptions object that specifies additional options for the request.

operationContext OperationContext

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

Returns

Task

A Task object that represents the current operation.

DeleteAsync(AccessCondition, FileRequestOptions, OperationContext, CancellationToken)

Returns a task that performs an asynchronous operation to delete the file.

[DoesServiceRequest]
public virtual Task DeleteAsync(AccessCondition accessCondition, FileRequestOptions options, OperationContext operationContext, CancellationToken cancellationToken)

Parameters

accessCondition AccessCondition

An AccessCondition object that represents the access conditions for the file. If null, no condition is used.

options FileRequestOptions

A FileRequestOptions 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

A Task object that represents the current operation.

DeleteAsync(CancellationToken)

Returns a task that performs an asynchronous operation to delete the file.

[DoesServiceRequest]
public virtual Task DeleteAsync(CancellationToken cancellationToken)

Parameters

cancellationToken CancellationToken

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

Returns

Task

A Task object that represents the current operation.

DeleteIfExists(AccessCondition, FileRequestOptions, OperationContext)

Deletes the file if it already exists.

[DoesServiceRequest]
public virtual bool DeleteIfExists(AccessCondition accessCondition = null, FileRequestOptions options = null, OperationContext operationContext = null)

Parameters

accessCondition AccessCondition

An AccessCondition object that represents the access conditions for the file. If null, no condition is used.

options FileRequestOptions

A FileRequestOptions object that specifies additional options for the request.

operationContext OperationContext

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

Returns

bool

true if the file did already exist and was deleted; otherwise false.

DeleteIfExistsAsync()

Returns a task that performs an asynchronous request to delete the file 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 file if it already exists.

[DoesServiceRequest]
public virtual Task<bool> DeleteIfExistsAsync(AccessCondition accessCondition, FileRequestOptions options, OperationContext operationContext)

Parameters

accessCondition AccessCondition

An AccessCondition object that represents the access conditions for the file. If null, no condition is used.

options FileRequestOptions

A FileRequestOptions object that specifies additional options for the request.

operationContext OperationContext

An 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 file if it already exists.

[DoesServiceRequest]
public virtual Task<bool> DeleteIfExistsAsync(AccessCondition accessCondition, FileRequestOptions options, OperationContext operationContext, CancellationToken cancellationToken)

Parameters

accessCondition AccessCondition

An AccessCondition object that represents the access conditions for the file. If null, no condition is used.

options FileRequestOptions

A FileRequestOptions 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<bool>

A Task<TResult> object that represents the current operation.

DeleteIfExistsAsync(CancellationToken)

Returns a task that performs an asynchronous request to delete the file if it already exists.

[DoesServiceRequest]
public virtual Task<bool> DeleteIfExistsAsync(CancellationToken cancellationToken)

Parameters

cancellationToken CancellationToken

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

Returns

Task<bool>

A Task<TResult> object that represents the current operation.

DownloadRangeToByteArray(byte[], int, long?, long?, AccessCondition, FileRequestOptions, OperationContext)

Downloads the contents of a file to a byte array.

[DoesServiceRequest]
public virtual int DownloadRangeToByteArray(byte[] target, int index, long? fileOffset, long? length, AccessCondition accessCondition = null, FileRequestOptions options = null, OperationContext operationContext = null)

Parameters

target byte[]

The target byte array.

index int

The starting offset in the byte array.

fileOffset long?

The starting offset of the data range, in bytes.

length long?

The length of the data to download from the file, in bytes.

accessCondition AccessCondition

An AccessCondition object that represents the access conditions for the file.

options FileRequestOptions

A FileRequestOptions object that specifies additional options for the request.

operationContext OperationContext

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

Returns

int

The total number of bytes read into the buffer.

DownloadRangeToByteArrayAsync(byte[], int, long?, long?)

Returns a task that performs an asynchronous operation to download the contents of a file to a byte array.

[DoesServiceRequest]
public virtual Task<int> DownloadRangeToByteArrayAsync(byte[] target, int index, long? fileOffset, long? length)

Parameters

target byte[]

The target byte array.

index int

The starting offset in the byte array.

fileOffset long?

The starting offset of the data range, in bytes.

length long?

The length of the data to download from the file, in bytes.

Returns

Task<int>

A Task object that represents the current operation.

DownloadRangeToByteArrayAsync(byte[], int, long?, long?, AccessCondition, FileRequestOptions, OperationContext)

Returns a task that performs an asynchronous operation to download the contents of a file to a byte array.

[DoesServiceRequest]
public virtual Task<int> DownloadRangeToByteArrayAsync(byte[] target, int index, long? fileOffset, long? length, AccessCondition accessCondition, FileRequestOptions options, OperationContext operationContext)

Parameters

target byte[]

The target byte array.

index int

The starting offset in the byte array.

fileOffset long?

The starting offset of the data range, in bytes.

length long?

The length of the data to download from the file, in bytes.

accessCondition AccessCondition

An AccessCondition object that represents the access conditions for the file.

options FileRequestOptions

An FileRequestOptions object that specifies additional options for the request.

operationContext OperationContext

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

Returns

Task<int>

A Task object that represents the current operation.

DownloadRangeToByteArrayAsync(byte[], int, long?, long?, AccessCondition, FileRequestOptions, OperationContext, IProgress<StorageProgress>, CancellationToken)

Returns a task that performs an asynchronous operation to download the contents of a file to a byte array.

[DoesServiceRequest]
public virtual Task<int> DownloadRangeToByteArrayAsync(byte[] target, int index, long? fileOffset, long? length, AccessCondition accessCondition, FileRequestOptions options, OperationContext operationContext, IProgress<StorageProgress> progressHandler, CancellationToken cancellationToken)

Parameters

target byte[]

The target byte array.

index int

The starting offset in the byte array.

fileOffset long?

The starting offset of the data range, in bytes.

length long?

The length of the data to download from the file, in bytes.

accessCondition AccessCondition

An AccessCondition object that represents the access conditions for the file.

options FileRequestOptions

An FileRequestOptions object that specifies additional options for the request.

operationContext OperationContext

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

progressHandler IProgress<StorageProgress>

A IProgress<T> object to handle StorageProgress messages.

cancellationToken CancellationToken

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

Returns

Task<int>

A Task object that represents the current operation.

DownloadRangeToByteArrayAsync(byte[], int, long?, long?, AccessCondition, FileRequestOptions, OperationContext, CancellationToken)

Returns a task that performs an asynchronous operation to download the contents of a file to a byte array.

[DoesServiceRequest]
public virtual Task<int> DownloadRangeToByteArrayAsync(byte[] target, int index, long? fileOffset, long? length, AccessCondition accessCondition, FileRequestOptions options, OperationContext operationContext, CancellationToken cancellationToken)

Parameters

target byte[]

The target byte array.

index int

The starting offset in the byte array.

fileOffset long?

The starting offset of the data range, in bytes.

length long?

The length of the data to download from the file, in bytes.

accessCondition AccessCondition

An AccessCondition object that represents the access conditions for the file.

options FileRequestOptions

An FileRequestOptions 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<int>

A Task object that represents the current operation.

DownloadRangeToByteArrayAsync(byte[], int, long?, long?, CancellationToken)

Returns a task that performs an asynchronous operation to download the contents of a file to a byte array.

[DoesServiceRequest]
public virtual Task<int> DownloadRangeToByteArrayAsync(byte[] target, int index, long? fileOffset, long? length, CancellationToken cancellationToken)

Parameters

target byte[]

The target byte array.

index int

The starting offset in the byte array.

fileOffset long?

The starting offset of the data range, in bytes.

length long?

The length of the data to download from the file, in bytes.

cancellationToken CancellationToken

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

Returns

Task<int>

A Task object that represents the current operation.

DownloadRangeToStream(Stream, long?, long?, AccessCondition, FileRequestOptions, OperationContext)

Downloads the contents of a file to a stream.

[DoesServiceRequest]
public virtual void DownloadRangeToStream(Stream target, long? offset, long? length, AccessCondition accessCondition = null, FileRequestOptions options = null, OperationContext operationContext = null)

Parameters

target Stream

The target stream.

offset long?

The starting offset of the data range, in bytes.

length long?

The length of the data range, in bytes.

accessCondition AccessCondition

An AccessCondition object that represents the access conditions for the file. If null, no condition is used.

options FileRequestOptions

A FileRequestOptions object that specifies additional options for the request.

operationContext OperationContext

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

DownloadRangeToStreamAsync(Stream, long?, long?)

Returns a task that performs an asynchronous operation to download the contents of a file to a stream.

[DoesServiceRequest]
public virtual Task DownloadRangeToStreamAsync(Stream target, long? offset, long? length)

Parameters

target Stream

The target stream.

offset long?

The starting offset of the data range, in bytes.

length long?

The length of the data range, in bytes.

Returns

Task

A Task object that represents the current operation.

DownloadRangeToStreamAsync(Stream, long?, long?, AccessCondition, FileRequestOptions, OperationContext)

Returns a task that performs an asynchronous operation to download the contents of a file to a stream.

[DoesServiceRequest]
public virtual Task DownloadRangeToStreamAsync(Stream target, long? offset, long? length, AccessCondition accessCondition, FileRequestOptions options, OperationContext operationContext)

Parameters

target Stream

The target stream.

offset long?

The starting offset of the data range, in bytes.

length long?

The length of the data range, in bytes.

accessCondition AccessCondition

An AccessCondition object that represents the access conditions for the file. If null, no condition is used.

options FileRequestOptions

A FileRequestOptions object that specifies additional options for the request.

operationContext OperationContext

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

Returns

Task

A Task object that represents the current operation.

DownloadRangeToStreamAsync(Stream, long?, long?, AccessCondition, FileRequestOptions, OperationContext, IProgress<StorageProgress>, CancellationToken)

Returns a task that performs an asynchronous operation to download the contents of a file to a stream.

[DoesServiceRequest]
public virtual Task DownloadRangeToStreamAsync(Stream target, long? offset, long? length, AccessCondition accessCondition, FileRequestOptions options, OperationContext operationContext, IProgress<StorageProgress> progressHandler, CancellationToken cancellationToken)

Parameters

target Stream

The target stream.

offset long?

The starting offset of the data range, in bytes.

length long?

The length of the data range, in bytes.

accessCondition AccessCondition

An AccessCondition object that represents the access conditions for the file. If null, no condition is used.

options FileRequestOptions

A FileRequestOptions object that specifies additional options for the request.

operationContext OperationContext

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

progressHandler IProgress<StorageProgress>

A IProgress<T> object to handle StorageProgress messages.

cancellationToken CancellationToken

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

Returns

Task

A Task object that represents the current operation.

DownloadRangeToStreamAsync(Stream, long?, long?, AccessCondition, FileRequestOptions, OperationContext, CancellationToken)

Returns a task that performs an asynchronous operation to download the contents of a file to a stream.

[DoesServiceRequest]
public virtual Task DownloadRangeToStreamAsync(Stream target, long? offset, long? length, AccessCondition accessCondition, FileRequestOptions options, OperationContext operationContext, CancellationToken cancellationToken)

Parameters

target Stream

The target stream.

offset long?

The starting offset of the data range, in bytes.

length long?

The length of the data range, in bytes.

accessCondition AccessCondition

An AccessCondition object that represents the access conditions for the file. If null, no condition is used.

options FileRequestOptions

A FileRequestOptions 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

A Task object that represents the current operation.

DownloadRangeToStreamAsync(Stream, long?, long?, CancellationToken)

Returns a task that performs an asynchronous operation to download the contents of a file to a stream.

[DoesServiceRequest]
public virtual Task DownloadRangeToStreamAsync(Stream target, long? offset, long? length, CancellationToken cancellationToken)

Parameters

target Stream

The target stream.

offset long?

The starting offset of the data range, in bytes.

length long?

The length of the data range, in bytes.

cancellationToken CancellationToken

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

Returns

Task

A Task object that represents the current operation.

DownloadText(Encoding, AccessCondition, FileRequestOptions, OperationContext)

Downloads the file's contents as a string.

[DoesServiceRequest]
public virtual string DownloadText(Encoding encoding = null, AccessCondition accessCondition = null, FileRequestOptions options = null, OperationContext operationContext = null)

Parameters

encoding Encoding

A Encoding object that indicates the type of text encoding to use.

accessCondition AccessCondition

An AccessCondition object that represents the access conditions for the file.

options FileRequestOptions

A FileRequestOptions object that specifies additional options for the request.

operationContext OperationContext

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

Returns

string

The contents of the file, as a string.

DownloadTextAsync()

Returns a task that performs an asynchronous operation to download the file's contents as a string.

[DoesServiceRequest]
public virtual Task<string> DownloadTextAsync()

Returns

Task<string>

A Task object that represents the current operation.

DownloadTextAsync(Encoding, AccessCondition, FileRequestOptions, OperationContext)

Returns a task that performs an asynchronous operation to download the file's contents as a string.

[DoesServiceRequest]
public virtual Task<string> DownloadTextAsync(Encoding encoding, AccessCondition accessCondition, FileRequestOptions options, OperationContext operationContext)

Parameters

encoding Encoding

A Encoding object that indicates the type of text encoding to use.

accessCondition AccessCondition

An AccessCondition object that represents the access conditions for the file.

options FileRequestOptions

An FileRequestOptions object that specifies additional options for the request.

operationContext OperationContext

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

Returns

Task<string>

A Task object that represents the current operation.

DownloadTextAsync(Encoding, AccessCondition, FileRequestOptions, OperationContext, IProgress<StorageProgress>, CancellationToken)

Returns a task that performs an asynchronous operation to download the file's contents as a string.

[DoesServiceRequest]
public virtual Task<string> DownloadTextAsync(Encoding encoding, AccessCondition accessCondition, FileRequestOptions options, OperationContext operationContext, IProgress<StorageProgress> progressHandler, CancellationToken cancellationToken)

Parameters

encoding Encoding

A Encoding object that indicates the type of text encoding to use.

accessCondition AccessCondition

An AccessCondition object that represents the access conditions for the file.

options FileRequestOptions

An FileRequestOptions object that specifies additional options for the request.

operationContext OperationContext

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

progressHandler IProgress<StorageProgress>

A IProgress<T> object to handle StorageProgress messages.

cancellationToken CancellationToken

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

Returns

Task<string>

A Task object that represents the current operation.

DownloadTextAsync(Encoding, AccessCondition, FileRequestOptions, OperationContext, CancellationToken)

Returns a task that performs an asynchronous operation to download the file's contents as a string.

[DoesServiceRequest]
public virtual Task<string> DownloadTextAsync(Encoding encoding, AccessCondition accessCondition, FileRequestOptions options, OperationContext operationContext, CancellationToken cancellationToken)

Parameters

encoding Encoding

A Encoding object that indicates the type of text encoding to use.

accessCondition AccessCondition

An AccessCondition object that represents the access conditions for the file.

options FileRequestOptions

An FileRequestOptions 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<string>

A Task object that represents the current operation.

DownloadTextAsync(CancellationToken)

Returns a task that performs an asynchronous operation to download the file's contents as a string.

[DoesServiceRequest]
public virtual Task<string> DownloadTextAsync(CancellationToken cancellationToken)

Parameters

cancellationToken CancellationToken

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

Returns

Task<string>

A Task object that represents the current operation.

DownloadToByteArray(byte[], int, AccessCondition, FileRequestOptions, OperationContext)

Downloads the contents of a file to a byte array.

[DoesServiceRequest]
public virtual int DownloadToByteArray(byte[] target, int index, AccessCondition accessCondition = null, FileRequestOptions options = null, OperationContext operationContext = null)

Parameters

target byte[]

The target byte array.

index int

The starting offset in the byte array.

accessCondition AccessCondition

An AccessCondition object that represents the access conditions for the file.

options FileRequestOptions

A FileRequestOptions object that specifies additional options for the request.

operationContext OperationContext

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

Returns

int

The total number of bytes read into the buffer.

DownloadToByteArrayAsync(byte[], int)

Returns a task that performs an asynchronous operation to download the contents of a file to a byte array.

[DoesServiceRequest]
public virtual Task<int> DownloadToByteArrayAsync(byte[] target, int index)

Parameters

target byte[]

The target byte array.

index int

The starting offset in the byte array.

Returns

Task<int>

A Task object that represents the current operation.

DownloadToByteArrayAsync(byte[], int, AccessCondition, FileRequestOptions, OperationContext)

Returns a task that performs an asynchronous operation to download the contents of a file to a byte array.

[DoesServiceRequest]
public virtual Task<int> DownloadToByteArrayAsync(byte[] target, int index, AccessCondition accessCondition, FileRequestOptions options, OperationContext operationContext)

Parameters

target byte[]

The target byte array.

index int

The starting offset in the byte array.

accessCondition AccessCondition

An AccessCondition object that represents the access conditions for the file.

options FileRequestOptions

An FileRequestOptions object that specifies additional options for the request.

operationContext OperationContext

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

Returns

Task<int>

A Task object that represents the current operation.

DownloadToByteArrayAsync(byte[], int, AccessCondition, FileRequestOptions, OperationContext, IProgress<StorageProgress>, CancellationToken)

Returns a task that performs an asynchronous operation to download the contents of a file to a byte array.

[DoesServiceRequest]
public virtual Task<int> DownloadToByteArrayAsync(byte[] target, int index, AccessCondition accessCondition, FileRequestOptions options, OperationContext operationContext, IProgress<StorageProgress> progressHandler, CancellationToken cancellationToken)

Parameters

target byte[]

The target byte array.

index int

The starting offset in the byte array.

accessCondition AccessCondition

An AccessCondition object that represents the access conditions for the file.

options FileRequestOptions

An FileRequestOptions object that specifies additional options for the request.

operationContext OperationContext

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

progressHandler IProgress<StorageProgress>

A IProgress<T> object to handle StorageProgress messages.

cancellationToken CancellationToken

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

Returns

Task<int>

A Task object that represents the current operation.

DownloadToByteArrayAsync(byte[], int, AccessCondition, FileRequestOptions, OperationContext, CancellationToken)

Returns a task that performs an asynchronous operation to download the contents of a file to a byte array.

[DoesServiceRequest]
public virtual Task<int> DownloadToByteArrayAsync(byte[] target, int index, AccessCondition accessCondition, FileRequestOptions options, OperationContext operationContext, CancellationToken cancellationToken)

Parameters

target byte[]

The target byte array.

index int

The starting offset in the byte array.

accessCondition AccessCondition

An AccessCondition object that represents the access conditions for the file.

options FileRequestOptions

An FileRequestOptions 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<int>

A Task object that represents the current operation.

DownloadToByteArrayAsync(byte[], int, CancellationToken)

Returns a task that performs an asynchronous operation to download the contents of a file to a byte array.

[DoesServiceRequest]
public virtual Task<int> DownloadToByteArrayAsync(byte[] target, int index, CancellationToken cancellationToken)

Parameters

target byte[]

The target byte array.

index int

The starting offset in the byte array.

cancellationToken CancellationToken

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

Returns

Task<int>

A Task object that represents the current operation.

DownloadToFile(string, FileMode, AccessCondition, FileRequestOptions, OperationContext)

Downloads the contents of a file in the File service to a local file.

[DoesServiceRequest]
public virtual void DownloadToFile(string path, FileMode mode, AccessCondition accessCondition = null, FileRequestOptions options = null, OperationContext operationContext = null)

Parameters

path string

The path to the target file in the local file system.

mode FileMode

A FileMode enumeration value that determines how to open or create the file.

accessCondition AccessCondition

An AccessCondition object that represents the access conditions for the file.

options FileRequestOptions

A FileRequestOptions object that specifies additional options for the request.

operationContext OperationContext

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

DownloadToFileAsync(string, FileMode)

Returns a task that performs an asynchronous operation to download the contents of a file in the File service to a local file.

[DoesServiceRequest]
public virtual Task DownloadToFileAsync(string path, FileMode mode)

Parameters

path string

The path to the target file in the local file system.

mode FileMode

A FileMode enumeration value that determines how to open or create the file.

Returns

Task

A Task object that represents the current operation.

DownloadToFileAsync(string, FileMode, AccessCondition, FileRequestOptions, OperationContext)

Returns a task that performs an asynchronous operation to download the contents of a file in the File service to a local file.

[DoesServiceRequest]
public virtual Task DownloadToFileAsync(string path, FileMode mode, AccessCondition accessCondition, FileRequestOptions options, OperationContext operationContext)

Parameters

path string

The path to the target file in the local file system.

mode FileMode

A FileMode enumeration value that determines how to open or create the file.

accessCondition AccessCondition

An AccessCondition object that represents the access conditions for the cloud file.

options FileRequestOptions

An FileRequestOptions object that specifies additional options for the request.

operationContext OperationContext

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

Returns

Task

A Task object that represents the current operation.

DownloadToFileAsync(string, FileMode, AccessCondition, FileRequestOptions, OperationContext, IProgress<StorageProgress>, CancellationToken)

Returns a task that performs an asynchronous operation to download the contents of a file in the File service to a local file.

[DoesServiceRequest]
public virtual Task DownloadToFileAsync(string path, FileMode mode, AccessCondition accessCondition, FileRequestOptions options, OperationContext operationContext, IProgress<StorageProgress> progressHandler, CancellationToken cancellationToken)

Parameters

path string

The path to the target file in the local file system.

mode FileMode

A FileMode enumeration value that determines how to open or create the file.

accessCondition AccessCondition

An AccessCondition object that represents the access conditions for the cloud file.

options FileRequestOptions

An FileRequestOptions object that specifies additional options for the request.

operationContext OperationContext

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

progressHandler IProgress<StorageProgress>

A IProgress<T> object to handle StorageProgress messages.

cancellationToken CancellationToken

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

Returns

Task

A Task object that represents the current operation.

DownloadToFileAsync(string, FileMode, AccessCondition, FileRequestOptions, OperationContext, CancellationToken)

Returns a task that performs an asynchronous operation to download the contents of a file in the File service to a local file.

[DoesServiceRequest]
public virtual Task DownloadToFileAsync(string path, FileMode mode, AccessCondition accessCondition, FileRequestOptions options, OperationContext operationContext, CancellationToken cancellationToken)

Parameters

path string

The path to the target file in the local file system.

mode FileMode

A FileMode enumeration value that determines how to open or create the file.

accessCondition AccessCondition

An AccessCondition object that represents the access conditions for the cloud file.

options FileRequestOptions

An FileRequestOptions 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

A Task object that represents the current operation.

DownloadToFileAsync(string, FileMode, CancellationToken)

Returns a task that performs an asynchronous operation to download the contents of a file in the File service to a local file.

[DoesServiceRequest]
public virtual Task DownloadToFileAsync(string path, FileMode mode, CancellationToken cancellationToken)

Parameters

path string

The path to the target file in the local file system.

mode FileMode

A FileMode enumeration value that determines how to open or create the file.

cancellationToken CancellationToken

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

Returns

Task

A Task object that represents the current operation.

DownloadToStream(Stream, AccessCondition, FileRequestOptions, OperationContext)

Downloads the contents of a file to a stream.

[DoesServiceRequest]
public virtual void DownloadToStream(Stream target, AccessCondition accessCondition = null, FileRequestOptions options = null, OperationContext operationContext = null)

Parameters

target Stream

The target stream.

accessCondition AccessCondition

An AccessCondition object that represents the access conditions for the file. If null, no condition is used.

options FileRequestOptions

A FileRequestOptions object that specifies additional options for the request.

operationContext OperationContext

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

DownloadToStreamAsync(Stream)

Returns a task that performs an asynchronous operation to download the contents of a file to a stream.

[DoesServiceRequest]
public virtual Task DownloadToStreamAsync(Stream target)

Parameters

target Stream

The target stream.

Returns

Task

A Task object that represents the current operation.

DownloadToStreamAsync(Stream, AccessCondition, FileRequestOptions, OperationContext)

Returns a task that performs an asynchronous operation to download the contents of a file to a stream.

[DoesServiceRequest]
public virtual Task DownloadToStreamAsync(Stream target, AccessCondition accessCondition, FileRequestOptions options, OperationContext operationContext)

Parameters

target Stream

The target stream.

accessCondition AccessCondition

An AccessCondition object that represents the access conditions for the file. If null, no condition is used.

options FileRequestOptions

A FileRequestOptions object that specifies additional options for the request.

operationContext OperationContext

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

Returns

Task

A Task object that represents the current operation.

DownloadToStreamAsync(Stream, AccessCondition, FileRequestOptions, OperationContext, IProgress<StorageProgress>, CancellationToken)

Returns a task that performs an asynchronous operation to download the contents of a file to a stream.

[DoesServiceRequest]
public virtual Task DownloadToStreamAsync(Stream target, AccessCondition accessCondition, FileRequestOptions options, OperationContext operationContext, IProgress<StorageProgress> progressHandler, CancellationToken cancellationToken)

Parameters

target Stream

The target stream.

accessCondition AccessCondition

An AccessCondition object that represents the access conditions for the file. If null, no condition is used.

options FileRequestOptions

A FileRequestOptions object that specifies additional options for the request.

operationContext OperationContext

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

progressHandler IProgress<StorageProgress>

A IProgress<T> object to handle StorageProgress messages.

cancellationToken CancellationToken

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

Returns

Task

A Task object that represents the current operation.

DownloadToStreamAsync(Stream, AccessCondition, FileRequestOptions, OperationContext, CancellationToken)

Returns a task that performs an asynchronous operation to download the contents of a file to a stream.

[DoesServiceRequest]
public virtual Task DownloadToStreamAsync(Stream target, AccessCondition accessCondition, FileRequestOptions options, OperationContext operationContext, CancellationToken cancellationToken)

Parameters

target Stream

The target stream.

accessCondition AccessCondition

An AccessCondition object that represents the access conditions for the file. If null, no condition is used.

options FileRequestOptions

A FileRequestOptions 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

A Task object that represents the current operation.

DownloadToStreamAsync(Stream, CancellationToken)

Returns a task that performs an asynchronous operation to download the contents of a file to a stream.

[DoesServiceRequest]
public virtual Task DownloadToStreamAsync(Stream target, CancellationToken cancellationToken)

Parameters

target Stream

The target stream.

cancellationToken CancellationToken

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

Returns

Task

A Task object that represents the current operation.

EndAbortCopy(IAsyncResult)

Ends an asynchronous operation to abort an ongoing copy operation.

public virtual void EndAbortCopy(IAsyncResult asyncResult)

Parameters

asyncResult IAsyncResult

An IAsyncResult that references the pending asynchronous operation.

EndClearRange(IAsyncResult)

Ends an asynchronous operation to clear ranges from a file.

public virtual void EndClearRange(IAsyncResult asyncResult)

Parameters

asyncResult IAsyncResult

An IAsyncResult that references the pending asynchronous operation.

EndCreate(IAsyncResult)

Ends an asynchronous operation to create a file.

public virtual void EndCreate(IAsyncResult asyncResult)

Parameters

asyncResult IAsyncResult

An IAsyncResult that references the pending asynchronous operation.

EndDelete(IAsyncResult)

Ends an asynchronous operation to delete the file.

public virtual void EndDelete(IAsyncResult asyncResult)

Parameters

asyncResult IAsyncResult

An IAsyncResult that references the pending asynchronous operation.

EndDeleteIfExists(IAsyncResult)

Returns the result of an asynchronous request to delete the file if it already exists.

public virtual bool EndDeleteIfExists(IAsyncResult asyncResult)

Parameters

asyncResult IAsyncResult

An IAsyncResult that references the pending asynchronous operation.

Returns

bool

true if the file did already exist and was deleted; otherwise, false.

EndDownloadRangeToByteArray(IAsyncResult)

Ends an asynchronous operation to download the contents of a file to a byte array.

public virtual int EndDownloadRangeToByteArray(IAsyncResult asyncResult)

Parameters

asyncResult IAsyncResult

An IAsyncResult that references the pending asynchronous operation.

Returns

int

The total number of bytes read into the buffer.

EndDownloadRangeToStream(IAsyncResult)

Ends an asynchronous operation to download the contents of a file to a stream.

public virtual void EndDownloadRangeToStream(IAsyncResult asyncResult)

Parameters

asyncResult IAsyncResult

An IAsyncResult that references the pending asynchronous operation.

EndDownloadText(IAsyncResult)

Ends an asynchronous operation to download the file's contents as a string.

public virtual string EndDownloadText(IAsyncResult asyncResult)

Parameters

asyncResult IAsyncResult

An IAsyncResult that references the pending asynchronous operation.

Returns

string

The contents of the file, as a string.

EndDownloadToByteArray(IAsyncResult)

Ends an asynchronous operation to download the contents of a file to a byte array.

public virtual int EndDownloadToByteArray(IAsyncResult asyncResult)

Parameters

asyncResult IAsyncResult

An IAsyncResult that references the pending asynchronous operation.

Returns

int

The total number of bytes read into the buffer.

EndDownloadToFile(IAsyncResult)

Ends an asynchronous operation to download the contents of a file in the File service to a local file.

public virtual void EndDownloadToFile(IAsyncResult asyncResult)

Parameters

asyncResult IAsyncResult

An IAsyncResult that references the pending asynchronous operation.

EndDownloadToStream(IAsyncResult)

Ends an asynchronous operation to download the contents of a file to a stream.

public virtual void EndDownloadToStream(IAsyncResult asyncResult)

Parameters

asyncResult IAsyncResult

An IAsyncResult that references the pending asynchronous operation.

EndExists(IAsyncResult)

Returns the asynchronous result of the request to check existence of the file.

public virtual bool EndExists(IAsyncResult asyncResult)

Parameters

asyncResult IAsyncResult

An IAsyncResult that references the pending asynchronous operation.

Returns

bool

true if the file exists; false, otherwise.

EndFetchAttributes(IAsyncResult)

Ends an asynchronous operation to populate the file's properties and metadata.

public virtual void EndFetchAttributes(IAsyncResult asyncResult)

Parameters

asyncResult IAsyncResult

An IAsyncResult that references the pending asynchronous operation.

EndListRanges(IAsyncResult)

Ends an asynchronous operation to return a collection of valid ranges and their starting and ending bytes.

public virtual IEnumerable<FileRange> EndListRanges(IAsyncResult asyncResult)

Parameters

asyncResult IAsyncResult

An IAsyncResult that references the pending asynchronous operation.

Returns

IEnumerable<FileRange>

An enumerable collection of ranges.

EndOpenRead(IAsyncResult)

Ends an asynchronous operation to open a stream for reading from the file.

public virtual Stream EndOpenRead(IAsyncResult asyncResult)

Parameters

asyncResult IAsyncResult

An IAsyncResult that references the pending asynchronous operation.

Returns

Stream

A stream to be used for reading from the file.

EndOpenWrite(IAsyncResult)

Ends an asynchronous operation to open a stream for writing to the file.

public virtual CloudFileStream EndOpenWrite(IAsyncResult asyncResult)

Parameters

asyncResult IAsyncResult

An IAsyncResult that references the pending asynchronous operation.

Returns

CloudFileStream

A CloudFileStream object to be used for writing to the file.

EndResize(IAsyncResult)

Ends an asynchronous operation to resize a file.

public virtual void EndResize(IAsyncResult asyncResult)

Parameters

asyncResult IAsyncResult

An IAsyncResult that references the pending asynchronous operation.

EndSetMetadata(IAsyncResult)

Ends an asynchronous operation to update the file's metadata.

public virtual void EndSetMetadata(IAsyncResult asyncResult)

Parameters

asyncResult IAsyncResult

An IAsyncResult that references the pending asynchronous operation.

EndSetProperties(IAsyncResult)

Ends an asynchronous operation to update the file's properties.

public virtual void EndSetProperties(IAsyncResult asyncResult)

Parameters

asyncResult IAsyncResult

An IAsyncResult that references the pending asynchronous operation.

EndStartCopy(IAsyncResult)

Ends an asynchronous operation to start copying another Azure file or blob's contents, properties, and metadata to this Azure file.

public virtual string EndStartCopy(IAsyncResult asyncResult)

Parameters

asyncResult IAsyncResult

An IAsyncResult that references the pending asynchronous operation.

Returns

string

The copy ID associated with the copy operation.

Remarks

This method fetches the file's ETag, last-modified time, and part of the copy state. The copy ID and copy status fields are fetched, and the rest of the copy state is cleared.

EndUploadFromByteArray(IAsyncResult)

Ends an asynchronous operation to upload the contents of a byte array to a file.

public virtual void EndUploadFromByteArray(IAsyncResult asyncResult)

Parameters

asyncResult IAsyncResult

An IAsyncResult that references the pending asynchronous operation.

EndUploadFromFile(IAsyncResult)

Ends an asynchronous operation to upload a file to the File service.

public virtual void EndUploadFromFile(IAsyncResult asyncResult)

Parameters

asyncResult IAsyncResult

An IAsyncResult that references the pending asynchronous operation.

EndUploadFromStream(IAsyncResult)

Ends an asynchronous operation to upload a stream to a file.

public virtual void EndUploadFromStream(IAsyncResult asyncResult)

Parameters

asyncResult IAsyncResult

An IAsyncResult that references the pending asynchronous operation.

EndUploadText(IAsyncResult)

Ends an asynchronous operation to upload a string of text to a file.

public virtual void EndUploadText(IAsyncResult asyncResult)

Parameters

asyncResult IAsyncResult

An IAsyncResult that references the pending asynchronous operation.

EndWriteRange(IAsyncResult)

Ends an asynchronous operation to write a range to a file.

public virtual void EndWriteRange(IAsyncResult asyncResult)

Parameters

asyncResult IAsyncResult

An IAsyncResult that references the pending asynchronous operation.

Exists(FileRequestOptions, OperationContext)

Checks existence of the file.

[DoesServiceRequest]
public virtual bool Exists(FileRequestOptions options = null, OperationContext operationContext = null)

Parameters

options FileRequestOptions

A FileRequestOptions object that specifies additional options for the request.

operationContext OperationContext

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

Returns

bool

true if the file exists; false, otherwise.

ExistsAsync()

Returns a task that performs an asynchronous request to check existence of the file.

[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 existence of the file.

[DoesServiceRequest]
public virtual Task<bool> ExistsAsync(FileRequestOptions options, OperationContext operationContext)

Parameters

options FileRequestOptions

A FileRequestOptions object that specifies additional options for the request.

operationContext OperationContext

An 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 existence of the file.

[DoesServiceRequest]
public virtual Task<bool> ExistsAsync(FileRequestOptions options, OperationContext operationContext, CancellationToken cancellationToken)

Parameters

options FileRequestOptions

A FileRequestOptions 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<bool>

A Task<TResult> object that represents the current operation.

ExistsAsync(CancellationToken)

Returns a task that performs an asynchronous request to check existence of the file.

[DoesServiceRequest]
public virtual Task<bool> ExistsAsync(CancellationToken cancellationToken)

Parameters

cancellationToken CancellationToken

A 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 file's properties and metadata.

[DoesServiceRequest]
public virtual void FetchAttributes(AccessCondition accessCondition = null, FileRequestOptions options = null, OperationContext operationContext = null)

Parameters

accessCondition AccessCondition

An AccessCondition object that represents the access conditions for the file. If null, no condition is used.

options FileRequestOptions

A FileRequestOptions object that specifies additional options for the request.

operationContext OperationContext

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

FetchAttributesAsync()

Returns a task that performs an asynchronous operation to populate the file's properties and metadata.

[DoesServiceRequest]
public virtual Task FetchAttributesAsync()

Returns

Task

A Task object that represents the current operation.

FetchAttributesAsync(AccessCondition, FileRequestOptions, OperationContext)

Returns a task that performs an asynchronous operation to populate the file's properties and metadata.

[DoesServiceRequest]
public virtual Task FetchAttributesAsync(AccessCondition accessCondition, FileRequestOptions options, OperationContext operationContext)

Parameters

accessCondition AccessCondition

An AccessCondition object that represents the access conditions for the file. If null, no condition is used.

options FileRequestOptions

A FileRequestOptions object that specifies additional options for the request.

operationContext OperationContext

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

Returns

Task

A Task object that represents the current operation.

FetchAttributesAsync(AccessCondition, FileRequestOptions, OperationContext, CancellationToken)

Returns a task that performs an asynchronous operation to populate the file's properties and metadata.

[DoesServiceRequest]
public virtual Task FetchAttributesAsync(AccessCondition accessCondition, FileRequestOptions options, OperationContext operationContext, CancellationToken cancellationToken)

Parameters

accessCondition AccessCondition

An AccessCondition object that represents the access conditions for the file. If null, no condition is used.

options FileRequestOptions

A FileRequestOptions 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

A Task object that represents the current operation.

FetchAttributesAsync(CancellationToken)

Returns a task that performs an asynchronous operation to populate the file's properties and metadata.

[DoesServiceRequest]
public virtual Task FetchAttributesAsync(CancellationToken cancellationToken)

Parameters

cancellationToken CancellationToken

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

Returns

Task

A Task object that represents the current operation.

GetSharedAccessSignature(SharedAccessFilePolicy)

Returns a shared access signature for the file.

public string GetSharedAccessSignature(SharedAccessFilePolicy policy)

Parameters

policy SharedAccessFilePolicy

A SharedAccessFilePolicy object specifying the access policy for the shared access signature.

Returns

string

A shared access signature, as a URI query string.

Remarks

The query string returned includes the leading question mark.

GetSharedAccessSignature(SharedAccessFilePolicy, SharedAccessFileHeaders)

Returns a shared access signature for the file.

public string GetSharedAccessSignature(SharedAccessFilePolicy policy, SharedAccessFileHeaders headers)

Parameters

policy SharedAccessFilePolicy

A SharedAccessFilePolicy object specifying the access policy for the shared access signature.

headers SharedAccessFileHeaders

A SharedAccessFileHeaders object specifying optional header values to set for a file accessed with this SAS.

Returns

string

A shared access signature, as a URI query string.

GetSharedAccessSignature(SharedAccessFilePolicy, SharedAccessFileHeaders, string)

Returns a shared access signature for the file.

public string GetSharedAccessSignature(SharedAccessFilePolicy policy, SharedAccessFileHeaders headers, string groupPolicyIdentifier)

Parameters

policy SharedAccessFilePolicy

A SharedAccessFilePolicy object specifying the access policy for the shared access signature.

headers SharedAccessFileHeaders

A SharedAccessFileHeaders object specifying optional header values to set for a file accessed with this SAS.

groupPolicyIdentifier string

A string identifying a stored access policy.

Returns

string

A shared access signature, as a URI query string.

GetSharedAccessSignature(SharedAccessFilePolicy, SharedAccessFileHeaders, string, SharedAccessProtocol?, IPAddressOrRange)

Returns a shared access signature for the file.

public string GetSharedAccessSignature(SharedAccessFilePolicy policy, SharedAccessFileHeaders headers, string groupPolicyIdentifier, SharedAccessProtocol? protocols, IPAddressOrRange ipAddressOrRange)

Parameters

policy SharedAccessFilePolicy

A SharedAccessFilePolicy object specifying the access policy for the shared access signature.

headers SharedAccessFileHeaders

A SharedAccessFileHeaders object specifying optional header values to set for a file accessed with this SAS.

groupPolicyIdentifier string

A string identifying a stored access policy.

protocols SharedAccessProtocol?

The allowed protocols (https only, or http and https). Null if you don't want to restrict protocol.

ipAddressOrRange IPAddressOrRange

The allowed IP address or IP address range. Null if you don't want to restrict based on IP address.

Returns

string

A shared access signature, as a URI query string.

GetSharedAccessSignature(SharedAccessFilePolicy, string)

Returns a shared access signature for the file.

public string GetSharedAccessSignature(SharedAccessFilePolicy policy, string groupPolicyIdentifier)

Parameters

policy SharedAccessFilePolicy

A SharedAccessFilePolicy object specifying the access policy for the shared access signature.

groupPolicyIdentifier string

A string identifying a stored access policy.

Returns

string

A shared access signature, as a URI query string.

Remarks

The query string returned includes the leading question mark.

ListRanges(long?, long?, AccessCondition, FileRequestOptions, OperationContext)

Gets a collection of valid ranges and their starting and ending bytes.

[DoesServiceRequest]
public virtual IEnumerable<FileRange> ListRanges(long? offset = null, long? length = null, AccessCondition accessCondition = null, FileRequestOptions options = null, OperationContext operationContext = null)

Parameters

offset long?

The starting offset of the data range over which to list file ranges, in bytes.

length long?

The length of the data range over which to list file ranges, in bytes.

accessCondition AccessCondition

An AccessCondition object that represents the access conditions for the file. If null, no condition is used.

options FileRequestOptions

A FileRequestOptions object that specifies additional options for the request.

operationContext OperationContext

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

Returns

IEnumerable<FileRange>

An enumerable collection of ranges.

ListRangesAsync()

Returns a task that performs an asynchronous operation to return a collection of valid ranges and their starting and ending bytes.

[DoesServiceRequest]
public virtual Task<IEnumerable<FileRange>> ListRangesAsync()

Returns

Task<IEnumerable<FileRange>>

A Task<TResult> object that represents the current operation.

ListRangesAsync(long?, long?, AccessCondition, FileRequestOptions, OperationContext)

Returns a task that performs an asynchronous operation to return a collection of valid ranges and their starting and ending bytes.

[DoesServiceRequest]
public virtual Task<IEnumerable<FileRange>> ListRangesAsync(long? offset, long? length, AccessCondition accessCondition, FileRequestOptions options, OperationContext operationContext)

Parameters

offset long?

The starting offset of the data range over which to list file ranges, in bytes.

length long?

The length of the data range over which to list file ranges, in bytes.

accessCondition AccessCondition

An AccessCondition object that represents the access conditions for the file. If null, no condition is used.

options FileRequestOptions

A FileRequestOptions object that specifies additional options for the request.

operationContext OperationContext

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

Returns

Task<IEnumerable<FileRange>>

A Task<TResult> object that represents the current operation.

ListRangesAsync(long?, long?, AccessCondition, FileRequestOptions, OperationContext, CancellationToken)

Returns a task that performs an asynchronous operation to return a collection of valid ranges and their starting and ending bytes.

[DoesServiceRequest]
public virtual Task<IEnumerable<FileRange>> ListRangesAsync(long? offset, long? length, AccessCondition accessCondition, FileRequestOptions options, OperationContext operationContext, CancellationToken cancellationToken)

Parameters

offset long?

The starting offset of the data range over which to list file ranges, in bytes.

length long?

The length of the data range over which to list file ranges, in bytes.

accessCondition AccessCondition

An AccessCondition object that represents the access conditions for the file. If null, no condition is used.

options FileRequestOptions

A FileRequestOptions 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<IEnumerable<FileRange>>

A Task<TResult> object that represents the current operation.

ListRangesAsync(CancellationToken)

Returns a task that performs an asynchronous operation to return a collection of valid ranges and their starting and ending bytes.

[DoesServiceRequest]
public virtual Task<IEnumerable<FileRange>> ListRangesAsync(CancellationToken cancellationToken)

Parameters

cancellationToken CancellationToken

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

Returns

Task<IEnumerable<FileRange>>

A Task<TResult> object that represents the current operation.

OpenRead(AccessCondition, FileRequestOptions, OperationContext)

Opens a stream for reading from the file.

[DoesServiceRequest]
public virtual Stream OpenRead(AccessCondition accessCondition = null, FileRequestOptions options = null, OperationContext operationContext = null)

Parameters

accessCondition AccessCondition

An AccessCondition object that represents the access conditions for the file. If null, no condition is used.

options FileRequestOptions

A FileRequestOptions object that specifies additional options for the request.

operationContext OperationContext

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

Returns

Stream

A stream to be used for reading from the file.

Remarks

On the Stream object returned by this method, the EndRead(IAsyncResult) method must be called exactly once for every BeginRead(byte[], int, int, AsyncCallback, object) call. Failing to end a read process before beginning another read can cause unknown behavior.

OpenReadAsync()

Returns a task that performs an asynchronous operation to open a stream for reading from the file.

[DoesServiceRequest]
public virtual Task<Stream> OpenReadAsync()

Returns

Task<Stream>

A Task<TResult> object that represents the current operation.

OpenReadAsync(AccessCondition, FileRequestOptions, OperationContext)

Returns a task that performs an asynchronous operation to open a stream for reading from the file.

[DoesServiceRequest]
public virtual Task<Stream> OpenReadAsync(AccessCondition accessCondition, FileRequestOptions options, OperationContext operationContext)

Parameters

accessCondition AccessCondition

An AccessCondition object that represents the access conditions for the file. If null, no condition is used.

options FileRequestOptions

A FileRequestOptions object that specifies additional options for the request.

operationContext OperationContext

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

Returns

Task<Stream>

A Task<TResult> object that represents the current operation.

OpenReadAsync(AccessCondition, FileRequestOptions, OperationContext, CancellationToken)

Returns a task that performs an asynchronous operation to open a stream for reading from the file.

[DoesServiceRequest]
public virtual Task<Stream> OpenReadAsync(AccessCondition accessCondition, FileRequestOptions options, OperationContext operationContext, CancellationToken cancellationToken)

Parameters

accessCondition AccessCondition

An AccessCondition object that represents the access conditions for the file. If null, no condition is used.

options FileRequestOptions

A FileRequestOptions 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<Stream>

A Task<TResult> object that represents the current operation.

OpenReadAsync(CancellationToken)

Returns a task that performs an asynchronous operation to open a stream for reading from the file.

[DoesServiceRequest]
public virtual Task<Stream> OpenReadAsync(CancellationToken cancellationToken)

Parameters

cancellationToken CancellationToken

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

Returns

Task<Stream>

A Task<TResult> object that represents the current operation.

OpenWrite(long?, AccessCondition, FileRequestOptions, OperationContext)

Opens a stream for writing to the file. If the file already exists, then existing data in the file may be overwritten.

[DoesServiceRequest]
public virtual CloudFileStream OpenWrite(long? size, AccessCondition accessCondition = null, FileRequestOptions options = null, OperationContext operationContext = null)

Parameters

size long?

The size of the file to create, in bytes, or null. If null, the file must already exist. If not null, a new file of the given size will be created. If size is not null but the file already exists on the service, the already-existing file will be deleted.

accessCondition AccessCondition

An AccessCondition object that represents the access conditions for the file. If null, no condition is used.

options FileRequestOptions

A FileRequestOptions object that specifies additional options for the request.

operationContext OperationContext

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

Returns

CloudFileStream

A CloudFileStream object to be used for writing to the file.

OpenWriteAsync(long?)

Returns a task that performs an asynchronous operation to open a stream for writing to the file. If the file already exists, then existing data in the file may be overwritten.

[DoesServiceRequest]
public virtual Task<CloudFileStream> OpenWriteAsync(long? size)

Parameters

size long?

The size of the file to create, in bytes, or null. If null, the file must already exist. If not null, a new file of the given size will be created. If size is not null but the file already exists on the service, the already-existing file will be deleted.

Returns

Task<CloudFileStream>

A Task<TResult> object that represents the current operation.

OpenWriteAsync(long?, AccessCondition, FileRequestOptions, OperationContext)

Returns a task that performs an asynchronous operation to open a stream for writing to the file. If the file already exists, then existing data in the file may be overwritten.

[DoesServiceRequest]
public virtual Task<CloudFileStream> OpenWriteAsync(long? size, AccessCondition accessCondition, FileRequestOptions options, OperationContext operationContext)

Parameters

size long?

The size of the file to create, in bytes, or null. If null, the file must already exist. If not null, a new file of the given size will be created. If size is not null but the file already exists on the service, the already-existing file will be deleted.

accessCondition AccessCondition

An AccessCondition object that represents the access conditions for the file. If null, no condition is used.

options FileRequestOptions

A FileRequestOptions object that specifies additional options for the request.

operationContext OperationContext

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

Returns

Task<CloudFileStream>

A Task<TResult> object that represents the current operation.

OpenWriteAsync(long?, AccessCondition, FileRequestOptions, OperationContext, CancellationToken)

Returns a task that performs an asynchronous operation to open a stream for writing to the file. If the file already exists, then existing data in the file may be overwritten.

[DoesServiceRequest]
public virtual Task<CloudFileStream> OpenWriteAsync(long? size, AccessCondition accessCondition, FileRequestOptions options, OperationContext operationContext, CancellationToken cancellationToken)

Parameters

size long?

The size of the file to create, in bytes, or null. If null, the file must already exist. If not null, a new file of the given size will be created. If size is not null but the file already exists on the service, the already-existing file will be deleted.

accessCondition AccessCondition

An AccessCondition object that represents the access conditions for the file. If null, no condition is used.

options FileRequestOptions

A FileRequestOptions 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<CloudFileStream>

A Task<TResult> object that represents the current operation.

OpenWriteAsync(long?, CancellationToken)

Returns a task that performs an asynchronous operation to open a stream for writing to the file. If the file already exists, then existing data in the file may be overwritten.

[DoesServiceRequest]
public virtual Task<CloudFileStream> OpenWriteAsync(long? size, CancellationToken cancellationToken)

Parameters

size long?

The size of the file to create, in bytes, or null. If null, the file must already exist. If not null, a new file of the given size will be created. If size is not null but the file already exists on the service, the already-existing file will be deleted.

cancellationToken CancellationToken

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

Returns

Task<CloudFileStream>

A Task<TResult> object that represents the current operation.

Resize(long, AccessCondition, FileRequestOptions, OperationContext)

Resizes a file.

[DoesServiceRequest]
public virtual void Resize(long size, AccessCondition accessCondition = null, FileRequestOptions options = null, OperationContext operationContext = null)

Parameters

size long

The maximum size of the file, in bytes.

accessCondition AccessCondition

An AccessCondition object that represents the access conditions for the file. If null, no condition is used.

options FileRequestOptions

An FileRequestOptions object that specifies additional options for the request.

operationContext OperationContext

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

ResizeAsync(long)

Returns a task that performs an asynchronous operation to resize a file.

[DoesServiceRequest]
public virtual Task ResizeAsync(long size)

Parameters

size long

The maximum size of the file, in bytes.

Returns

Task

A Task object that represents the current operation.

ResizeAsync(long, AccessCondition, FileRequestOptions, OperationContext)

Returns a task that performs an asynchronous operation to resize a file.

[DoesServiceRequest]
public virtual Task ResizeAsync(long size, AccessCondition accessCondition, FileRequestOptions options, OperationContext operationContext)

Parameters

size long

The maximum size of the file, in bytes.

accessCondition AccessCondition

An AccessCondition object that represents the access conditions for the file. If null, no condition is used.

options FileRequestOptions

A FileRequestOptions object that specifies additional options for the request.

operationContext OperationContext

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

Returns

Task

A Task object that represents the current operation.

ResizeAsync(long, AccessCondition, FileRequestOptions, OperationContext, CancellationToken)

Returns a task that performs an asynchronous operation to resize a file.

[DoesServiceRequest]
public virtual Task ResizeAsync(long size, AccessCondition accessCondition, FileRequestOptions options, OperationContext operationContext, CancellationToken cancellationToken)

Parameters

size long

The maximum size of the file, in bytes.

accessCondition AccessCondition

An AccessCondition object that represents the access conditions for the file. If null, no condition is used.

options FileRequestOptions

A FileRequestOptions 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

A Task object that represents the current operation.

ResizeAsync(long, CancellationToken)

Returns a task that performs an asynchronous operation to resize a file.

[DoesServiceRequest]
public virtual Task ResizeAsync(long size, CancellationToken cancellationToken)

Parameters

size long

The maximum size of the file, in bytes.

cancellationToken CancellationToken

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

Returns

Task

A Task object that represents the current operation.

SetMetadata(AccessCondition, FileRequestOptions, OperationContext)

Updates the file's metadata.

[DoesServiceRequest]
public virtual void SetMetadata(AccessCondition accessCondition = null, FileRequestOptions options = null, OperationContext operationContext = null)

Parameters

accessCondition AccessCondition

An AccessCondition object that represents the access conditions for the file. If null, no condition is used.

options FileRequestOptions

An FileRequestOptions object that specifies additional options for the request.

operationContext OperationContext

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

SetMetadataAsync()

Returns a task that performs an asynchronous operation to update the file's metadata.

[DoesServiceRequest]
public virtual Task SetMetadataAsync()

Returns

Task

A Task object that represents the current operation.

SetMetadataAsync(AccessCondition, FileRequestOptions, OperationContext)

Returns a task that performs an asynchronous operation to update the file's metadata.

[DoesServiceRequest]
public virtual Task SetMetadataAsync(AccessCondition accessCondition, FileRequestOptions options, OperationContext operationContext)

Parameters

accessCondition AccessCondition

An AccessCondition object that represents the access conditions for the file. If null, no condition is used.

options FileRequestOptions

A FileRequestOptions object that specifies additional options for the request.

operationContext OperationContext

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

Returns

Task

A Task object that represents the current operation.

SetMetadataAsync(AccessCondition, FileRequestOptions, OperationContext, CancellationToken)

Returns a task that performs an asynchronous operation to update the file's metadata.

[DoesServiceRequest]
public virtual Task SetMetadataAsync(AccessCondition accessCondition, FileRequestOptions options, OperationContext operationContext, CancellationToken cancellationToken)

Parameters

accessCondition AccessCondition

An AccessCondition object that represents the access conditions for the file. If null, no condition is used.

options FileRequestOptions

A FileRequestOptions 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

A Task object that represents the current operation.

SetMetadataAsync(CancellationToken)

Returns a task that performs an asynchronous operation to update the file's metadata.

[DoesServiceRequest]
public virtual Task SetMetadataAsync(CancellationToken cancellationToken)

Parameters

cancellationToken CancellationToken

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

Returns

Task

A Task object that represents the current operation.

SetProperties(AccessCondition, FileRequestOptions, OperationContext)

Updates the file's properties.

[DoesServiceRequest]
public virtual void SetProperties(AccessCondition accessCondition = null, FileRequestOptions options = null, OperationContext operationContext = null)

Parameters

accessCondition AccessCondition

An AccessCondition object that represents the access conditions for the file. If null, no condition is used.

options FileRequestOptions

An FileRequestOptions object that specifies additional options for the request.

operationContext OperationContext

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

SetPropertiesAsync()

Returns a task that performs an asynchronous operation to update the file's properties.

[DoesServiceRequest]
public virtual Task SetPropertiesAsync()

Returns

Task

A Task object that represents the current operation.

SetPropertiesAsync(AccessCondition, FileRequestOptions, OperationContext)

Returns a task that performs an asynchronous operation to update the file's properties.

[DoesServiceRequest]
public virtual Task SetPropertiesAsync(AccessCondition accessCondition, FileRequestOptions options, OperationContext operationContext)

Parameters

accessCondition AccessCondition

An AccessCondition object that represents the access conditions for the file. If null, no condition is used.

options FileRequestOptions

A FileRequestOptions object that specifies additional options for the request.

operationContext OperationContext

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

Returns

Task

A Task object that represents the current operation.

SetPropertiesAsync(AccessCondition, FileRequestOptions, OperationContext, CancellationToken)

Returns a task that performs an asynchronous operation to update the file's properties.

[DoesServiceRequest]
public virtual Task SetPropertiesAsync(AccessCondition accessCondition, FileRequestOptions options, OperationContext operationContext, CancellationToken cancellationToken)

Parameters

accessCondition AccessCondition

An AccessCondition object that represents the access conditions for the file. If null, no condition is used.

options FileRequestOptions

A FileRequestOptions 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

A Task object that represents the current operation.

SetPropertiesAsync(CancellationToken)

Returns a task that performs an asynchronous operation to update the file's properties.

[DoesServiceRequest]
public virtual Task SetPropertiesAsync(CancellationToken cancellationToken)

Parameters

cancellationToken CancellationToken

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

Returns

Task

A Task object that represents the current operation.

StartCopy(CloudBlob, AccessCondition, AccessCondition, FileRequestOptions, OperationContext)

Begins an operation to start copying a blob's contents, properties, and metadata to this Azure file.

[DoesServiceRequest]
public virtual string StartCopy(CloudBlob source, AccessCondition sourceAccessCondition = null, AccessCondition destAccessCondition = null, FileRequestOptions options = null, OperationContext operationContext = null)

Parameters

source CloudBlob

The CloudBlob of the source blob.

sourceAccessCondition AccessCondition

An AccessCondition object that represents the access conditions for the source blob. If null, no condition is used.

destAccessCondition AccessCondition

An AccessCondition object that represents the access conditions for the destination file. If null, no condition is used.

options FileRequestOptions

A FileRequestOptions 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

string

The copy ID associated with the copy operation.

Remarks

This method fetches the file's ETag, last-modified time, and part of the copy state. The copy ID and copy status fields are fetched, and the rest of the copy state is cleared.

StartCopy(CloudFile, AccessCondition, AccessCondition, FileRequestOptions, OperationContext)

Begins an operation to start copying another file's contents, properties, and metadata to this file.

[DoesServiceRequest]
public virtual string StartCopy(CloudFile source, AccessCondition sourceAccessCondition = null, AccessCondition destAccessCondition = null, FileRequestOptions options = null, OperationContext operationContext = null)

Parameters

source CloudFile

A CloudFile object.

sourceAccessCondition AccessCondition

An AccessCondition object that represents the access conditions for the source file. If null, no condition is used.

destAccessCondition AccessCondition

An AccessCondition object that represents the access conditions for the destination file. If null, no condition is used.

options FileRequestOptions

A FileRequestOptions 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

string

The copy ID associated with the copy operation.

Remarks

This method fetches the file's ETag, last-modified time, and part of the copy state. The copy ID and copy status fields are fetched, and the rest of the copy state is cleared.

StartCopy(Uri, AccessCondition, AccessCondition, FileRequestOptions, OperationContext)

Begins an operation to start copying another Azure file or blob's contents, properties, and metadata to this Azure file.

[DoesServiceRequest]
public virtual string StartCopy(Uri source, AccessCondition sourceAccessCondition = null, AccessCondition destAccessCondition = null, FileRequestOptions options = null, OperationContext operationContext = null)

Parameters

source Uri

The System.Uri of the source blob or file.

sourceAccessCondition AccessCondition

An AccessCondition object that represents the access conditions for the source object. If null, no condition is used.

destAccessCondition AccessCondition

An AccessCondition object that represents the access conditions for the destination file. If null, no condition is used.

options FileRequestOptions

A FileRequestOptions 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

string

The copy ID associated with the copy operation.

Remarks

This method fetches the file's ETag, last-modified time, and part of the copy state. The copy ID and copy status fields are fetched, and the rest of the copy state is cleared.

StartCopyAsync(CloudBlob)

Initiates an asynchronous operation to start copying a blob's contents, properties, and metadata to this Azure file.

[DoesServiceRequest]
public virtual Task<string> StartCopyAsync(CloudBlob source)

Parameters

source CloudBlob

The CloudBlob that is the source blob.

Returns

Task<string>

A Task<TResult> object of type string that represents the asynchronous operation.

StartCopyAsync(CloudBlob, AccessCondition, AccessCondition, FileRequestOptions, OperationContext)

Initiates an asynchronous operation to start copying a blob's contents, properties, and metadata to this Azure file.

[DoesServiceRequest]
public virtual Task<string> StartCopyAsync(CloudBlob source, AccessCondition sourceAccessCondition, AccessCondition destAccessCondition, FileRequestOptions options, OperationContext operationContext)

Parameters

source CloudBlob

The CloudBlob that is the source blob.

sourceAccessCondition AccessCondition

An AccessCondition object that represents the access conditions for the source blob. If null, no condition is used.

destAccessCondition AccessCondition

An AccessCondition object that represents the access conditions for the destination file. If null, no condition is used.

options FileRequestOptions

A FileRequestOptions object that specifies additional options for the request.

operationContext OperationContext

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

Returns

Task<string>

A Task<TResult> object of type string that represents the asynchronous operation.

StartCopyAsync(CloudBlob, AccessCondition, AccessCondition, FileRequestOptions, OperationContext, CancellationToken)

Initiates an asynchronous operation to start copying a blob's contents, properties, and metadata to this Azure file.

[DoesServiceRequest]
public virtual Task<string> StartCopyAsync(CloudBlob source, AccessCondition sourceAccessCondition, AccessCondition destAccessCondition, FileRequestOptions options, OperationContext operationContext, CancellationToken cancellationToken)

Parameters

source CloudBlob

The CloudBlob that is the source blob.

sourceAccessCondition AccessCondition

An AccessCondition object that represents the access conditions for the source blob. If null, no condition is used.

destAccessCondition AccessCondition

An AccessCondition object that represents the access conditions for the destination file. If null, no condition is used.

options FileRequestOptions

A FileRequestOptions 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<string>

A Task<TResult> object of type string that represents the asynchronous operation.

StartCopyAsync(CloudBlob, CancellationToken)

Initiates an asynchronous operation to start copying a blob's contents, properties, and metadata to this Azure file.

[DoesServiceRequest]
public virtual Task<string> StartCopyAsync(CloudBlob source, CancellationToken cancellationToken)

Parameters

source CloudBlob

The CloudBlob that is the source blob.

cancellationToken CancellationToken

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

Returns

Task<string>

A Task<TResult> object of type string that represents the asynchronous operation.

StartCopyAsync(CloudFile)

Initiates an asynchronous operation to start copying another file's contents, properties, and metadata to this file.

[DoesServiceRequest]
public virtual Task<string> StartCopyAsync(CloudFile source)

Parameters

source CloudFile

A CloudFile object.

Returns

Task<string>

A Task<TResult> object of type string that represents the asynchronous operation.

StartCopyAsync(CloudFile, AccessCondition, AccessCondition, FileRequestOptions, OperationContext)

Initiates an asynchronous operation to start copying another file's contents, properties, and metadata to this file.

[DoesServiceRequest]
public virtual Task<string> StartCopyAsync(CloudFile source, AccessCondition sourceAccessCondition, AccessCondition destAccessCondition, FileRequestOptions options, OperationContext operationContext)

Parameters

source CloudFile

A CloudFile object.

sourceAccessCondition AccessCondition

An AccessCondition object that represents the access conditions for the source file. If null, no condition is used.

destAccessCondition AccessCondition

An AccessCondition object that represents the access conditions for the destination file. If null, no condition is used.

options FileRequestOptions

A FileRequestOptions object that specifies additional options for the request.

operationContext OperationContext

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

Returns

Task<string>

A Task<TResult> object of type string that represents the asynchronous operation.

StartCopyAsync(CloudFile, AccessCondition, AccessCondition, FileRequestOptions, OperationContext, CancellationToken)

Initiates an asynchronous operation to start copying another file's contents, properties, and metadata to this file.

[DoesServiceRequest]
public virtual Task<string> StartCopyAsync(CloudFile source, AccessCondition sourceAccessCondition, AccessCondition destAccessCondition, FileRequestOptions options, OperationContext operationContext, CancellationToken cancellationToken)

Parameters

source CloudFile

A CloudFile object.

sourceAccessCondition AccessCondition

An AccessCondition object that represents the access conditions for the source file. If null, no condition is used.

destAccessCondition AccessCondition

An AccessCondition object that represents the access conditions for the destination file. If null, no condition is used.

options FileRequestOptions

A FileRequestOptions 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<string>

A Task<TResult> object of type string that represents the asynchronous operation.

StartCopyAsync(CloudFile, CancellationToken)

Initiates an asynchronous operation to start copying another file's contents, properties, and metadata to this file.

[DoesServiceRequest]
public virtual Task<string> StartCopyAsync(CloudFile source, CancellationToken cancellationToken)

Parameters

source CloudFile

A CloudFile object.

cancellationToken CancellationToken

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

Returns

Task<string>

A Task<TResult> object of type string that represents the asynchronous operation.

StartCopyAsync(Uri)

Initiates an asynchronous operation to start copying another Azure file or blob's contents, properties, and metadata to this Azure file.

[DoesServiceRequest]
public virtual Task<string> StartCopyAsync(Uri source)

Parameters

source Uri

The System.Uri of the source blob or file.

Returns

Task<string>

A Task<TResult> object of type string that represents the asynchronous operation.

StartCopyAsync(Uri, AccessCondition, AccessCondition, FileRequestOptions, OperationContext)

Initiates an asynchronous operation to start copying another Azure file or blob's contents, properties, and metadata to this Azure file.

[DoesServiceRequest]
public virtual Task<string> StartCopyAsync(Uri source, AccessCondition sourceAccessCondition, AccessCondition destAccessCondition, FileRequestOptions options, OperationContext operationContext)

Parameters

source Uri

The System.Uri of the source blob or file.

sourceAccessCondition AccessCondition

An AccessCondition object that represents the access conditions for the source object. If null, no condition is used.

destAccessCondition AccessCondition

An AccessCondition object that represents the access conditions for the destination file. If null, no condition is used.

options FileRequestOptions

A FileRequestOptions object that specifies additional options for the request.

operationContext OperationContext

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

Returns

Task<string>

A Task<TResult> object of type string that represents the asynchronous operation.

StartCopyAsync(Uri, AccessCondition, AccessCondition, FileRequestOptions, OperationContext, CancellationToken)

Initiates an asynchronous operation to start copying another Azure file or blob's contents, properties, and metadata to this Azure file.

[DoesServiceRequest]
public virtual Task<string> StartCopyAsync(Uri source, AccessCondition sourceAccessCondition, AccessCondition destAccessCondition, FileRequestOptions options, OperationContext operationContext, CancellationToken cancellationToken)

Parameters

source Uri

The System.Uri of the source blob or file.

sourceAccessCondition AccessCondition

An AccessCondition object that represents the access conditions for the source object. If null, no condition is used.

destAccessCondition AccessCondition

An AccessCondition object that represents the access conditions for the destination file. If null, no condition is used.

options FileRequestOptions

A FileRequestOptions 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<string>

A Task<TResult> object of type string that represents the asynchronous operation.

StartCopyAsync(Uri, CancellationToken)

Initiates an asynchronous operation to start copying another Azure file or blob's contents, properties, and metadata to this Azure file.

[DoesServiceRequest]
public virtual Task<string> StartCopyAsync(Uri source, CancellationToken cancellationToken)

Parameters

source Uri

The System.Uri of the source blob or file.

cancellationToken CancellationToken

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

Returns

Task<string>

A Task<TResult> object of type string that represents the asynchronous operation.

UploadFromByteArray(byte[], int, int, AccessCondition, FileRequestOptions, OperationContext)

Uploads the contents of a byte array to a file. If the file already exists on the service, it will be overwritten.

[DoesServiceRequest]
public virtual void UploadFromByteArray(byte[] buffer, int index, int count, AccessCondition accessCondition = null, FileRequestOptions options = null, OperationContext operationContext = null)

Parameters

buffer byte[]

An array of bytes.

index int

The zero-based byte offset in buffer at which to begin uploading bytes to the file.

count int

The number of bytes to be written to the file.

accessCondition AccessCondition

An AccessCondition object that represents the access conditions for the file.

options FileRequestOptions

A FileRequestOptions object that specifies additional options for the request.

operationContext OperationContext

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

UploadFromByteArrayAsync(byte[], int, int)

Returns a task that performs an asynchronous operation to upload the contents of a byte array to a file. If the file already exists on the service, it will be overwritten.

[DoesServiceRequest]
public virtual Task UploadFromByteArrayAsync(byte[] buffer, int index, int count)

Parameters

buffer byte[]

An array of bytes.

index int

The zero-based byte offset in buffer at which to begin uploading bytes to the file.

count int

The number of bytes to be written to the file.

Returns

Task

A Task object that represents the current operation.

UploadFromByteArrayAsync(byte[], int, int, AccessCondition, FileRequestOptions, OperationContext)

Returns a task that performs an asynchronous operation to upload the contents of a byte array to a file. If the file already exists on the service, it will be overwritten.

[DoesServiceRequest]
public virtual Task UploadFromByteArrayAsync(byte[] buffer, int index, int count, AccessCondition accessCondition, FileRequestOptions options, OperationContext operationContext)

Parameters

buffer byte[]

An array of bytes.

index int

The zero-based byte offset in buffer at which to begin uploading bytes to the file.

count int

The number of bytes to be written to the file.

accessCondition AccessCondition

An AccessCondition object that represents the access conditions for the file.

options FileRequestOptions

An FileRequestOptions object that specifies additional options for the request.

operationContext OperationContext

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

Returns

Task

A Task object that represents the current operation.

UploadFromByteArrayAsync(byte[], int, int, AccessCondition, FileRequestOptions, OperationContext, IProgress<StorageProgress>, CancellationToken)

Returns a task that performs an asynchronous operation to upload the contents of a byte array to a file. If the file already exists on the service, it will be overwritten.

[DoesServiceRequest]
public virtual Task UploadFromByteArrayAsync(byte[] buffer, int index, int count, AccessCondition accessCondition, FileRequestOptions options, OperationContext operationContext, IProgress<StorageProgress> progressHandler, CancellationToken cancellationToken)

Parameters

buffer byte[]

An array of bytes.

index int

The zero-based byte offset in buffer at which to begin uploading bytes to the file.

count int

The number of bytes to be written to the file.

accessCondition AccessCondition

An AccessCondition object that represents the access conditions for the file.

options FileRequestOptions

An FileRequestOptions object that specifies additional options for the request.

operationContext OperationContext

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

progressHandler IProgress<StorageProgress>

A IProgress<T> object to handle StorageProgress messages.

cancellationToken CancellationToken

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

Returns

Task

A Task object that represents the current operation.

UploadFromByteArrayAsync(byte[], int, int, AccessCondition, FileRequestOptions, OperationContext, CancellationToken)

Returns a task that performs an asynchronous operation to upload the contents of a byte array to a file. If the file already exists on the service, it will be overwritten.

[DoesServiceRequest]
public virtual Task UploadFromByteArrayAsync(byte[] buffer, int index, int count, AccessCondition accessCondition, FileRequestOptions options, OperationContext operationContext, CancellationToken cancellationToken)

Parameters

buffer byte[]

An array of bytes.

index int

The zero-based byte offset in buffer at which to begin uploading bytes to the file.

count int

The number of bytes to be written to the file.

accessCondition AccessCondition

An AccessCondition object that represents the access conditions for the file.

options FileRequestOptions

An FileRequestOptions 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

A Task object that represents the current operation.

UploadFromByteArrayAsync(byte[], int, int, CancellationToken)

Returns a task that performs an asynchronous operation to upload the contents of a byte array to a file. If the file already exists on the service, it will be overwritten.

[DoesServiceRequest]
public virtual Task UploadFromByteArrayAsync(byte[] buffer, int index, int count, CancellationToken cancellationToken)

Parameters

buffer byte[]

An array of bytes.

index int

The zero-based byte offset in buffer at which to begin uploading bytes to the file.

count int

The number of bytes to be written to the file.

cancellationToken CancellationToken

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

Returns

Task

A Task object that represents the current operation.

UploadFromFile(string, AccessCondition, FileRequestOptions, OperationContext)

Uploads a file to the File service. If the file already exists on the service, it will be overwritten.

[DoesServiceRequest]
public virtual void UploadFromFile(string path, AccessCondition accessCondition = null, FileRequestOptions options = null, OperationContext operationContext = null)

Parameters

path string

The file providing the content.

accessCondition AccessCondition

An AccessCondition object that represents the access conditions for the file.

options FileRequestOptions

A FileRequestOptions object that specifies additional options for the request.

operationContext OperationContext

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

UploadFromFileAsync(string)

Returns a task that performs an asynchronous operation to upload a local file to the File service. If the file already exists on the service, it will be overwritten.

[DoesServiceRequest]
public virtual Task UploadFromFileAsync(string path)

Parameters

path string

The file providing the file content.

Returns

Task

A Task object that represents the current operation.

UploadFromFileAsync(string, AccessCondition, FileRequestOptions, OperationContext)

Returns a task that performs an asynchronous operation to upload a local file to the File service. If the file already exists on the service, it will be overwritten.

[DoesServiceRequest]
public virtual Task UploadFromFileAsync(string path, AccessCondition accessCondition, FileRequestOptions options, OperationContext operationContext)

Parameters

path string

The file providing the file content.

accessCondition AccessCondition

An AccessCondition object that represents the access conditions for the file.

options FileRequestOptions

An FileRequestOptions object that specifies additional options for the request.

operationContext OperationContext

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

Returns

Task

A Task object that represents the current operation.

UploadFromFileAsync(string, AccessCondition, FileRequestOptions, OperationContext, IProgress<StorageProgress>, CancellationToken)

Returns a task that performs an asynchronous operation to upload a local file to the File service. If the file already exists on the service, it will be overwritten.

[DoesServiceRequest]
public virtual Task UploadFromFileAsync(string path, AccessCondition accessCondition, FileRequestOptions options, OperationContext operationContext, IProgress<StorageProgress> progressHandler, CancellationToken cancellationToken)

Parameters

path string

The file providing the file content.

accessCondition AccessCondition

An AccessCondition object that represents the access conditions for the file.

options FileRequestOptions

An FileRequestOptions object that specifies additional options for the request.

operationContext OperationContext

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

progressHandler IProgress<StorageProgress>

A IProgress<T> object to handle StorageProgress messages.

cancellationToken CancellationToken

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

Returns

Task

A Task object that represents the current operation.

UploadFromFileAsync(string, AccessCondition, FileRequestOptions, OperationContext, CancellationToken)

Returns a task that performs an asynchronous operation to upload a local file to the File service. If the file already exists on the service, it will be overwritten.

[DoesServiceRequest]
public virtual Task UploadFromFileAsync(string path, AccessCondition accessCondition, FileRequestOptions options, OperationContext operationContext, CancellationToken cancellationToken)

Parameters

path string

The file providing the file content.

accessCondition AccessCondition

An AccessCondition object that represents the access conditions for the file.

options FileRequestOptions

An FileRequestOptions 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

A Task object that represents the current operation.

UploadFromFileAsync(string, CancellationToken)

Returns a task that performs an asynchronous operation to upload a local file to the File service. If the file already exists on the service, it will be overwritten.

[DoesServiceRequest]
public virtual Task UploadFromFileAsync(string path, CancellationToken cancellationToken)

Parameters

path string

The file providing the file content.

cancellationToken CancellationToken

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

Returns

Task

A Task object that represents the current operation.

UploadFromStream(Stream, AccessCondition, FileRequestOptions, OperationContext)

Uploads a stream to a file. If the file already exists on the service, it will be overwritten.

[DoesServiceRequest]
public virtual void UploadFromStream(Stream source, AccessCondition accessCondition = null, FileRequestOptions options = null, OperationContext operationContext = null)

Parameters

source Stream

The stream providing the file content.

accessCondition AccessCondition

An AccessCondition object that represents the access conditions for the file. If null, no condition is used.

options FileRequestOptions

A FileRequestOptions object that specifies additional options for the request.

operationContext OperationContext

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

UploadFromStream(Stream, long, AccessCondition, FileRequestOptions, OperationContext)

Uploads a stream to a file. If the file already exists on the service, it will be overwritten.

[DoesServiceRequest]
public virtual void UploadFromStream(Stream source, long length, AccessCondition accessCondition = null, FileRequestOptions options = null, OperationContext operationContext = null)

Parameters

source Stream

The stream providing the file content.

length long

The number of bytes to write from the source stream at its current position.

accessCondition AccessCondition

An AccessCondition object that represents the access conditions for the file. If null, no condition is used.

options FileRequestOptions

A FileRequestOptions object that specifies additional options for the request.

operationContext OperationContext

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

UploadFromStreamAsync(Stream)

Returns a task that performs an asynchronous operation to upload a stream to a file. If the file already exists on the service, it will be overwritten.

[DoesServiceRequest]
public virtual Task UploadFromStreamAsync(Stream source)

Parameters

source Stream

The stream providing the file content.

Returns

Task

A Task object that represents the current operation.

UploadFromStreamAsync(Stream, AccessCondition, FileRequestOptions, OperationContext)

Returns a task that performs an asynchronous operation to upload a stream to a file. If the file already exists on the service, it will be overwritten.

[DoesServiceRequest]
public virtual Task UploadFromStreamAsync(Stream source, AccessCondition accessCondition, FileRequestOptions options, OperationContext operationContext)

Parameters

source Stream

The stream providing the file content.

accessCondition AccessCondition

An AccessCondition object that represents the access conditions for the file. If null, no condition is used.

options FileRequestOptions

A FileRequestOptions object that specifies additional options for the request.

operationContext OperationContext

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

Returns

Task

A Task object that represents the current operation.

UploadFromStreamAsync(Stream, AccessCondition, FileRequestOptions, OperationContext, IProgress<StorageProgress>, CancellationToken)

Returns a task that performs an asynchronous operation to upload a stream to a file. If the file already exists on the service, it will be overwritten.

[DoesServiceRequest]
public virtual Task UploadFromStreamAsync(Stream source, AccessCondition accessCondition, FileRequestOptions options, OperationContext operationContext, IProgress<StorageProgress> progressHandler, CancellationToken cancellationToken)

Parameters

source Stream

The stream providing the file content.

accessCondition AccessCondition

An AccessCondition object that represents the access conditions for the file. If null, no condition is used.

options FileRequestOptions

A FileRequestOptions object that specifies additional options for the request.

operationContext OperationContext

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

progressHandler IProgress<StorageProgress>

A IProgress<T> object to handle StorageProgress messages.

cancellationToken CancellationToken

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

Returns

Task

A Task object that represents the current operation.

UploadFromStreamAsync(Stream, AccessCondition, FileRequestOptions, OperationContext, CancellationToken)

Returns a task that performs an asynchronous operation to upload a stream to a file. If the file already exists on the service, it will be overwritten.

[DoesServiceRequest]
public virtual Task UploadFromStreamAsync(Stream source, AccessCondition accessCondition, FileRequestOptions options, OperationContext operationContext, CancellationToken cancellationToken)

Parameters

source Stream

The stream providing the file content.

accessCondition AccessCondition

An AccessCondition object that represents the access conditions for the file. If null, no condition is used.

options FileRequestOptions

A FileRequestOptions 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

A Task object that represents the current operation.

UploadFromStreamAsync(Stream, long)

Returns a task that performs an asynchronous operation to upload a stream to a file. If the file already exists on the service, it will be overwritten.

[DoesServiceRequest]
public virtual Task UploadFromStreamAsync(Stream source, long length)

Parameters

source Stream

The stream providing the file content.

length long

The number of bytes to write from the source stream at its current position.

Returns

Task

A Task object that represents the current operation.

UploadFromStreamAsync(Stream, long, AccessCondition, FileRequestOptions, OperationContext)

Returns a task that performs an asynchronous operation to upload a stream to a file. If the file already exists on the service, it will be overwritten.

[DoesServiceRequest]
public virtual Task UploadFromStreamAsync(Stream source, long length, AccessCondition accessCondition, FileRequestOptions options, OperationContext operationContext)

Parameters

source Stream

The stream providing the file content.

length long

The number of bytes to write from the source stream at its current position.

accessCondition AccessCondition

An AccessCondition object that represents the access conditions for the file. If null, no condition is used.

options FileRequestOptions

An FileRequestOptions object that specifies additional options for the request.

operationContext OperationContext

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

Returns

Task

A Task object that represents the current operation.

UploadFromStreamAsync(Stream, long, AccessCondition, FileRequestOptions, OperationContext, IProgress<StorageProgress>, CancellationToken)

Returns a task that performs an asynchronous operation to upload a stream to a file. If the file already exists on the service, it will be overwritten.

[DoesServiceRequest]
public virtual Task UploadFromStreamAsync(Stream source, long length, AccessCondition accessCondition, FileRequestOptions options, OperationContext operationContext, IProgress<StorageProgress> progressHandler, CancellationToken cancellationToken)

Parameters

source Stream

The stream providing the file content.

length long

The number of bytes to write from the source stream at its current position.

accessCondition AccessCondition

An AccessCondition object that represents the access conditions for the file. If null, no condition is used.

options FileRequestOptions

An FileRequestOptions object that specifies additional options for the request.

operationContext OperationContext

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

progressHandler IProgress<StorageProgress>

A IProgress<T> object to handle StorageProgress messages.

cancellationToken CancellationToken

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

Returns

Task

A Task object that represents the current operation.

UploadFromStreamAsync(Stream, long, AccessCondition, FileRequestOptions, OperationContext, CancellationToken)

Returns a task that performs an asynchronous operation to upload a stream to a file. If the file already exists on the service, it will be overwritten.

[DoesServiceRequest]
public virtual Task UploadFromStreamAsync(Stream source, long length, AccessCondition accessCondition, FileRequestOptions options, OperationContext operationContext, CancellationToken cancellationToken)

Parameters

source Stream

The stream providing the file content.

length long

The number of bytes to write from the source stream at its current position.

accessCondition AccessCondition

An AccessCondition object that represents the access conditions for the file. If null, no condition is used.

options FileRequestOptions

An FileRequestOptions 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

A Task object that represents the current operation.

UploadFromStreamAsync(Stream, long, CancellationToken)

Returns a task that performs an asynchronous operation to upload a stream to a file. If the file already exists on the service, it will be overwritten.

[DoesServiceRequest]
public virtual Task UploadFromStreamAsync(Stream source, long length, CancellationToken cancellationToken)

Parameters

source Stream

The stream providing the file content.

length long

The number of bytes to write from the source stream at its current position.

cancellationToken CancellationToken

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

Returns

Task

A Task object that represents the current operation.

UploadFromStreamAsync(Stream, CancellationToken)

Returns a task that performs an asynchronous operation to upload a stream to a file. If the file already exists on the service, it will be overwritten.

[DoesServiceRequest]
public virtual Task UploadFromStreamAsync(Stream source, CancellationToken cancellationToken)

Parameters

source Stream

The stream providing the file content.

cancellationToken CancellationToken

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

Returns

Task

A Task object that represents the current operation.

UploadText(string, Encoding, AccessCondition, FileRequestOptions, OperationContext)

Uploads a string of text to a file. If the file already exists on the service, it will be overwritten.

[DoesServiceRequest]
public virtual void UploadText(string content, Encoding encoding = null, AccessCondition accessCondition = null, FileRequestOptions options = null, OperationContext operationContext = null)

Parameters

content string

The text to upload.

encoding Encoding

An object that indicates the text encoding to use. If null, UTF-8 will be used.

accessCondition AccessCondition

An AccessCondition object that represents the access conditions for the file.

options FileRequestOptions

A FileRequestOptions object that specifies additional options for the request.

operationContext OperationContext

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

UploadTextAsync(string)

Returns a task that performs an asynchronous operation to upload a string of text to a file. If the file already exists on the service, it will be overwritten.

[DoesServiceRequest]
public virtual Task UploadTextAsync(string content)

Parameters

content string

The text to upload.

Returns

Task

A Task object that represents the current operation.

UploadTextAsync(string, Encoding, AccessCondition, FileRequestOptions, OperationContext)

Returns a task that performs an asynchronous operation to upload a string of text to a file. If the file already exists on the service, it will be overwritten.

[DoesServiceRequest]
public virtual Task UploadTextAsync(string content, Encoding encoding, AccessCondition accessCondition, FileRequestOptions options, OperationContext operationContext)

Parameters

content string

The text to upload.

encoding Encoding

An object that indicates the text encoding to use. If null, UTF-8 will be used.

accessCondition AccessCondition

An AccessCondition object that represents the access conditions for the file.

options FileRequestOptions

An FileRequestOptions object that specifies additional options for the request.

operationContext OperationContext

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

Returns

Task

A Task object that represents the current operation.

UploadTextAsync(string, Encoding, AccessCondition, FileRequestOptions, OperationContext, IProgress<StorageProgress>, CancellationToken)

Returns a task that performs an asynchronous operation to upload a string of text to a file. If the file already exists on the service, it will be overwritten.

[DoesServiceRequest]
public virtual Task UploadTextAsync(string content, Encoding encoding, AccessCondition accessCondition, FileRequestOptions options, OperationContext operationContext, IProgress<StorageProgress> progressHandler, CancellationToken cancellationToken)

Parameters

content string

The text to upload.

encoding Encoding

An object that indicates the text encoding to use. If null, UTF-8 will be used.

accessCondition AccessCondition

An AccessCondition object that represents the access conditions for the file.

options FileRequestOptions

An FileRequestOptions object that specifies additional options for the request.

operationContext OperationContext

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

progressHandler IProgress<StorageProgress>

A IProgress<T> object to handle StorageProgress messages.

cancellationToken CancellationToken

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

Returns

Task

A Task object that represents the current operation.

UploadTextAsync(string, Encoding, AccessCondition, FileRequestOptions, OperationContext, CancellationToken)

Returns a task that performs an asynchronous operation to upload a string of text to a file. If the file already exists on the service, it will be overwritten.

[DoesServiceRequest]
public virtual Task UploadTextAsync(string content, Encoding encoding, AccessCondition accessCondition, FileRequestOptions options, OperationContext operationContext, CancellationToken cancellationToken)

Parameters

content string

The text to upload.

encoding Encoding

An object that indicates the text encoding to use. If null, UTF-8 will be used.

accessCondition AccessCondition

An AccessCondition object that represents the access conditions for the file.

options FileRequestOptions

An FileRequestOptions 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

A Task object that represents the current operation.

UploadTextAsync(string, CancellationToken)

Returns a task that performs an asynchronous operation to upload a string of text to a file. If the file already exists on the service, it will be overwritten.

[DoesServiceRequest]
public virtual Task UploadTextAsync(string content, CancellationToken cancellationToken)

Parameters

content string

The text to upload.

cancellationToken CancellationToken

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

Returns

Task

A Task object that represents the current operation.

WriteRange(Stream, long, string, AccessCondition, FileRequestOptions, OperationContext)

Writes range to a file.

[DoesServiceRequest]
public virtual void WriteRange(Stream rangeData, long startOffset, string contentMD5 = null, AccessCondition accessCondition = null, FileRequestOptions options = null, OperationContext operationContext = null)

Parameters

rangeData Stream

A stream providing the data.

startOffset long

The offset at which to begin writing, in bytes.

contentMD5 string

An optional hash value that will be used to set the ContentMD5 property on the file. May be null or an empty string.

accessCondition AccessCondition

An AccessCondition object that represents the access conditions for the file. If null, no condition is used.

options FileRequestOptions

An FileRequestOptions object that specifies additional options for the request.

operationContext OperationContext

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

WriteRangeAsync(Stream, long, string)

Returns a task that performs an asynchronous operation to write a range to a file.

[DoesServiceRequest]
public virtual Task WriteRangeAsync(Stream rangeData, long startOffset, string contentMD5)

Parameters

rangeData Stream

A stream providing the data.

startOffset long

The offset at which to begin writing, in bytes.

contentMD5 string

An optional hash value that will be used to set the ContentMD5 property on the file. May be null or an empty string.

Returns

Task

A Task object that represents the current operation.

WriteRangeAsync(Stream, long, string, AccessCondition, FileRequestOptions, OperationContext)

Returns a task that performs an asynchronous operation to write a range to a file.

[DoesServiceRequest]
public virtual Task WriteRangeAsync(Stream rangeData, long startOffset, string contentMD5, AccessCondition accessCondition, FileRequestOptions options, OperationContext operationContext)

Parameters

rangeData Stream

A stream providing the data.

startOffset long

The offset at which to begin writing, in bytes.

contentMD5 string

An optional hash value that will be used to set the ContentMD5 property on the file. May be null or an empty string.

accessCondition AccessCondition

An AccessCondition object that represents the access conditions for the file. If null, no condition is used.

options FileRequestOptions

A FileRequestOptions object that specifies additional options for the request.

operationContext OperationContext

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

Returns

Task

A Task object that represents the current operation.

WriteRangeAsync(Stream, long, string, AccessCondition, FileRequestOptions, OperationContext, IProgress<StorageProgress>, CancellationToken)

Returns a task that performs an asynchronous operation to write a range to a file.

[DoesServiceRequest]
public virtual Task WriteRangeAsync(Stream rangeData, long startOffset, string contentMD5, AccessCondition accessCondition, FileRequestOptions options, OperationContext operationContext, IProgress<StorageProgress> progressHandler, CancellationToken cancellationToken)

Parameters

rangeData Stream

A stream providing the data.

startOffset long

The offset at which to begin writing, in bytes.

contentMD5 string

An optional hash value that will be used to set the ContentMD5 property on the file. May be null or an empty string.

accessCondition AccessCondition

An AccessCondition object that represents the access conditions for the file. If null, no condition is used.

options FileRequestOptions

A FileRequestOptions object that specifies additional options for the request.

operationContext OperationContext

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

progressHandler IProgress<StorageProgress>

A IProgress<T> object to handle StorageProgress messages.

cancellationToken CancellationToken

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

Returns

Task

A Task object that represents the current operation.

WriteRangeAsync(Stream, long, string, AccessCondition, FileRequestOptions, OperationContext, CancellationToken)

Returns a task that performs an asynchronous operation to write a range to a file.

[DoesServiceRequest]
public virtual Task WriteRangeAsync(Stream rangeData, long startOffset, string contentMD5, AccessCondition accessCondition, FileRequestOptions options, OperationContext operationContext, CancellationToken cancellationToken)

Parameters

rangeData Stream

A stream providing the data.

startOffset long

The offset at which to begin writing, in bytes.

contentMD5 string

An optional hash value that will be used to set the ContentMD5 property on the file. May be null or an empty string.

accessCondition AccessCondition

An AccessCondition object that represents the access conditions for the file. If null, no condition is used.

options FileRequestOptions

A FileRequestOptions 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

A Task object that represents the current operation.

WriteRangeAsync(Stream, long, string, CancellationToken)

Returns a task that performs an asynchronous operation to write a range to a file.

[DoesServiceRequest]
public virtual Task WriteRangeAsync(Stream rangeData, long startOffset, string contentMD5, CancellationToken cancellationToken)

Parameters

rangeData Stream

A stream providing the data.

startOffset long

The offset at which to begin writing, in bytes.

contentMD5 string

An optional hash value that will be used to set the ContentMD5 property on the file. May be null or an empty string.

cancellationToken CancellationToken

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

Returns

Task

A Task object that represents the current operation.