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
StorageUriThe absolute URI to the file.
credentials
StorageCredentialsA 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
UriThe 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
UriThe absolute URI to the file.
credentials
StorageCredentialsA 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
stringA string identifying the copy operation.
accessCondition
AccessConditionAn AccessCondition object that represents the condition that must be met in order for the request to proceed. If
null
, no condition is used.options
FileRequestOptionsA FileRequestOptions object that specifies additional options for the request. If
null
, default options are applied to the request.operationContext
OperationContextAn OperationContext object that represents the context for the current operation.
AbortCopyAsync(string)
Initiates an asynchronous operation to abort an ongoing copy operation.
[DoesServiceRequest]
public virtual Task AbortCopyAsync(string copyId)
Parameters
copyId
stringA string identifying the copy operation.
Returns
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
stringA string identifying the copy operation.
accessCondition
AccessConditionAn AccessCondition object that represents the condition that must be met in order for the request to proceed. If
null
, no condition is used.options
FileRequestOptionsA FileRequestOptions object that specifies additional options for the request.
operationContext
OperationContextAn OperationContext object that represents the context for the current operation.
Returns
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
stringA string identifying the copy operation.
accessCondition
AccessConditionAn AccessCondition object that represents the condition that must be met in order for the request to proceed. If
null
, no condition is used.options
FileRequestOptionsA FileRequestOptions object that specifies additional options for the request.
operationContext
OperationContextAn OperationContext object that represents the context for the current operation.
cancellationToken
CancellationTokenA CancellationToken to observe while waiting for a task to complete.
Returns
AbortCopyAsync(string, CancellationToken)
Initiates an asynchronous operation to abort an ongoing copy operation.
[DoesServiceRequest]
public virtual Task AbortCopyAsync(string copyId, CancellationToken cancellationToken)
Parameters
copyId
stringA string identifying the copy operation.
cancellationToken
CancellationTokenA CancellationToken to observe while waiting for a task to complete.
Returns
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
stringA string identifying the copy operation.
accessCondition
AccessConditionAn AccessCondition object that represents the condition that must be met in order for the request to proceed. If
null
, no condition is used.options
FileRequestOptionsA FileRequestOptions object that specifies additional options for the request.
operationContext
OperationContextAn OperationContext object that represents the context for the current operation.
callback
AsyncCallbackAn AsyncCallback delegate that will receive notification when the asynchronous operation completes.
state
objectA user-defined object that will be passed to the callback delegate.
Returns
- ICancellableAsyncResult
An ICancellableAsyncResult that references the asynchronous operation.
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
stringA string identifying the copy operation.
callback
AsyncCallbackAn AsyncCallback delegate that will receive notification when the asynchronous operation completes.
state
objectA user-defined object that will be passed to the callback delegate.
Returns
- ICancellableAsyncResult
An ICancellableAsyncResult that references the asynchronous operation.
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
longThe offset at which to begin clearing ranges, in bytes.
length
longThe length of the data range to be cleared, in bytes.
accessCondition
AccessConditionAn AccessCondition object that represents the access conditions for the file. If
null
, no condition is used.options
FileRequestOptionsAn FileRequestOptions object that specifies additional options for the request.
operationContext
OperationContextAn OperationContext object that represents the context for the current operation.
callback
AsyncCallbackThe callback delegate that will receive notification when the asynchronous operation completes.
state
objectA user-defined object that will be passed to the callback delegate.
Returns
- ICancellableAsyncResult
An ICancellableAsyncResult that references the asynchronous operation.
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
longThe offset at which to begin clearing ranges, in bytes.
length
longThe length of the data range to be cleared, in bytes.
callback
AsyncCallbackThe callback delegate that will receive notification when the asynchronous operation completes.
state
objectA user-defined object that will be passed to the callback delegate.
Returns
- ICancellableAsyncResult
An ICancellableAsyncResult that references the asynchronous operation.
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
longThe maximum size of the file, in bytes.
accessCondition
AccessConditionAn AccessCondition object that represents the access conditions for the file. If
null
, no condition is used.options
FileRequestOptionsA FileRequestOptions object that specifies additional options for the request.
operationContext
OperationContextAn OperationContext object that represents the context for the current operation.
callback
AsyncCallbackThe callback delegate that will receive notification when the asynchronous operation completes.
state
objectA user-defined object that will be passed to the callback delegate.
Returns
- ICancellableAsyncResult
An ICancellableAsyncResult that references the asynchronous operation.
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
longThe maximum size of the file, in bytes.
callback
AsyncCallbackThe callback delegate that will receive notification when the asynchronous operation completes.
state
objectA user-defined object that will be passed to the callback delegate.
Returns
- ICancellableAsyncResult
An ICancellableAsyncResult that references the asynchronous operation.
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
AccessConditionAn AccessCondition object that represents the access conditions for the file. If
null
, no condition is used.options
FileRequestOptionsA FileRequestOptions object that specifies additional options for the request.
operationContext
OperationContextAn OperationContext object that represents the context for the current operation.
callback
AsyncCallbackThe callback delegate that will receive notification when the asynchronous operation completes.
state
objectA user-defined object that will be passed to the callback delegate.
Returns
- ICancellableAsyncResult
An ICancellableAsyncResult that references the asynchronous operation.
BeginDelete(AsyncCallback, object)
Begins an asynchronous operation to delete the file.
[DoesServiceRequest]
public virtual ICancellableAsyncResult BeginDelete(AsyncCallback callback, object state)
Parameters
callback
AsyncCallbackThe callback delegate that will receive notification when the asynchronous operation completes.
state
objectA user-defined object that will be passed to the callback delegate.
Returns
- ICancellableAsyncResult
An 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
AccessConditionAn AccessCondition object that represents the access conditions for the file. If
null
, no condition is used.options
FileRequestOptionsA FileRequestOptions object that specifies additional options for the request.
operationContext
OperationContextAn OperationContext object that represents the context for the current operation.
callback
AsyncCallbackThe callback delegate that will receive notification when the asynchronous operation completes.
state
objectA user-defined object that will be passed to the callback delegate.
Returns
- ICancellableAsyncResult
An ICancellableAsyncResult that references the asynchronous operation.
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
AsyncCallbackThe callback delegate that will receive notification when the asynchronous operation completes.
state
objectA user-defined object that will be passed to the callback delegate.
Returns
- ICancellableAsyncResult
An ICancellableAsyncResult that references the asynchronous operation.
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
intThe 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
AccessConditionAn AccessCondition object that represents the access conditions for the file.
options
FileRequestOptionsA FileRequestOptions object that specifies additional options for the request.
operationContext
OperationContextAn OperationContext object that represents the context for the current operation.
callback
AsyncCallbackThe callback delegate that will receive notification when the asynchronous operation completes.
state
objectA user-defined object that will be passed to the callback delegate.
Returns
- ICancellableAsyncResult
An ICancellableAsyncResult that references the asynchronous operation.
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
intThe 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
AsyncCallbackThe callback delegate that will receive notification when the asynchronous operation completes.
state
objectA user-defined object that will be passed to the callback delegate.
Returns
- ICancellableAsyncResult
An ICancellableAsyncResult that references the asynchronous operation.
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
StreamThe target stream.
offset
long?The starting offset of the data range, in bytes.
length
long?The length of the data range, in bytes.
accessCondition
AccessConditionAn AccessCondition object that represents the access conditions for the file. If
null
, no condition is used.options
FileRequestOptionsA FileRequestOptions object that specifies additional options for the request.
operationContext
OperationContextAn OperationContext object that represents the context for the current operation.
callback
AsyncCallbackThe callback delegate that will receive notification when the asynchronous operation completes.
state
objectA user-defined object that will be passed to the callback delegate.
Returns
- ICancellableAsyncResult
An ICancellableAsyncResult that references the asynchronous operation.
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
StreamThe target stream.
offset
long?The starting offset of the data range, in bytes.
length
long?The length of the data range, in bytes.
callback
AsyncCallbackThe callback delegate that will receive notification when the asynchronous operation completes.
state
objectA user-defined object that will be passed to the callback delegate.
Returns
- ICancellableAsyncResult
An ICancellableAsyncResult that references the asynchronous operation.
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
AsyncCallbackThe callback delegate that will receive notification when the asynchronous operation completes.
state
objectA user-defined object that will be passed to the callback delegate.
Returns
- ICancellableAsyncResult
An ICancellableAsyncResult that references the asynchronous operation.
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
EncodingA Encoding object that indicates the type of text encoding to use.
accessCondition
AccessConditionAn AccessCondition object that represents the access conditions for the file.
options
FileRequestOptionsA FileRequestOptions object that specifies additional options for the request.
operationContext
OperationContextAn OperationContext object that represents the context for the current operation.
callback
AsyncCallbackThe callback delegate that will receive notification when the asynchronous operation completes.
state
objectA user-defined object that will be passed to the callback delegate.
Returns
- ICancellableAsyncResult
An ICancellableAsyncResult that references the asynchronous operation.
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
intThe starting offset in the byte array.
accessCondition
AccessConditionAn AccessCondition object that represents the access conditions for the file.
options
FileRequestOptionsA FileRequestOptions object that specifies additional options for the request.
operationContext
OperationContextAn OperationContext object that represents the context for the current operation.
callback
AsyncCallbackThe callback delegate that will receive notification when the asynchronous operation completes.
state
objectA user-defined object that will be passed to the callback delegate.
Returns
- ICancellableAsyncResult
An ICancellableAsyncResult that references the asynchronous operation.
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
intThe starting offset in the byte array.
callback
AsyncCallbackThe callback delegate that will receive notification when the asynchronous operation completes.
state
objectA user-defined object that will be passed to the callback delegate.
Returns
- ICancellableAsyncResult
An ICancellableAsyncResult that references the asynchronous operation.
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
stringThe path to the target file in the local file system.
mode
FileModeA FileMode enumeration value that determines how to open or create the file.
accessCondition
AccessConditionAn AccessCondition object that represents the access conditions for the file.
options
FileRequestOptionsA FileRequestOptions object that specifies additional options for the request.
operationContext
OperationContextAn OperationContext object that represents the context for the current operation.
callback
AsyncCallbackThe callback delegate that will receive notification when the asynchronous operation completes.
state
objectA user-defined object that will be passed to the callback delegate.
Returns
- ICancellableAsyncResult
An ICancellableAsyncResult that references the asynchronous operation.
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
stringThe path to the target file in the local file system.
mode
FileModeA FileMode enumeration value that determines how to open or create the file.
callback
AsyncCallbackThe callback delegate that will receive notification when the asynchronous operation completes.
state
objectA user-defined object that will be passed to the callback delegate.
Returns
- ICancellableAsyncResult
An ICancellableAsyncResult that references the asynchronous operation.
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
StreamThe target stream.
accessCondition
AccessConditionAn AccessCondition object that represents the access conditions for the file. If
null
, no condition is used.options
FileRequestOptionsA FileRequestOptions object that specifies additional options for the request.
operationContext
OperationContextAn OperationContext object that represents the context for the current operation.
callback
AsyncCallbackThe callback delegate that will receive notification when the asynchronous operation completes.
state
objectA user-defined object that will be passed to the callback delegate.
Returns
- ICancellableAsyncResult
An ICancellableAsyncResult that references the asynchronous operation.
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
StreamThe target stream.
callback
AsyncCallbackThe callback delegate that will receive notification when the asynchronous operation completes.
state
objectA user-defined object that will be passed to the callback delegate.
Returns
- ICancellableAsyncResult
An ICancellableAsyncResult that references the asynchronous operation.
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
FileRequestOptionsA FileRequestOptions object that specifies additional options for the request.
operationContext
OperationContextAn OperationContext object that represents the context for the current operation.
callback
AsyncCallbackThe callback delegate that will receive notification when the asynchronous operation completes.
state
objectA user-defined object that will be passed to the callback delegate.
Returns
- ICancellableAsyncResult
An ICancellableAsyncResult that references the asynchronous operation.
BeginExists(AsyncCallback, object)
Begins an asynchronous request to check existence of the file.
[DoesServiceRequest]
public virtual ICancellableAsyncResult BeginExists(AsyncCallback callback, object state)
Parameters
callback
AsyncCallbackThe callback delegate that will receive notification when the asynchronous operation completes.
state
objectA user-defined object that will be passed to the callback delegate.
Returns
- ICancellableAsyncResult
An 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
AccessConditionAn AccessCondition object that represents the access conditions for the file. If
null
, no condition is used.options
FileRequestOptionsA FileRequestOptions object that specifies additional options for the request.
operationContext
OperationContextAn OperationContext object that represents the context for the current operation.
callback
AsyncCallbackThe callback delegate that will receive notification when the asynchronous operation completes.
state
objectA user-defined object that will be passed to the callback delegate.
Returns
- ICancellableAsyncResult
An ICancellableAsyncResult that references the asynchronous operation.
BeginFetchAttributes(AsyncCallback, object)
Begins an asynchronous operation to populate the file's properties and metadata.
[DoesServiceRequest]
public virtual ICancellableAsyncResult BeginFetchAttributes(AsyncCallback callback, object state)
Parameters
callback
AsyncCallbackThe callback delegate that will receive notification when the asynchronous operation completes.
state
objectA user-defined object that will be passed to the callback delegate.
Returns
- ICancellableAsyncResult
An ICancellableAsyncResult that references the asynchronous operation.
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
AsyncCallbackThe callback delegate that will receive notification when the asynchronous operation completes.
state
objectA user-defined object that will be passed to the callback delegate.
Returns
- ICancellableAsyncResult
An ICancellableAsyncResult that references the asynchronous operation.
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
AccessConditionAn AccessCondition object that represents the access conditions for the file. If
null
, no condition is used.options
FileRequestOptionsAn FileRequestOptions object that specifies additional options for the request.
operationContext
OperationContextAn OperationContext object that represents the context for the current operation.
callback
AsyncCallbackThe callback delegate that will receive notification when the asynchronous operation completes.
state
objectA user-defined object that will be passed to the callback delegate.
Returns
- ICancellableAsyncResult
An ICancellableAsyncResult that references the asynchronous operation.
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
AccessConditionAn AccessCondition object that represents the access conditions for the file. If
null
, no condition is used.options
FileRequestOptionsA FileRequestOptions object that specifies additional options for the request.
operationContext
OperationContextAn OperationContext object that represents the context for the current operation.
callback
AsyncCallbackThe callback delegate that will receive notification when the asynchronous operation completes.
state
objectA user-defined object that will be passed to the callback delegate.
Returns
- ICancellableAsyncResult
An ICancellableAsyncResult that references the asynchronous operation.
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
AsyncCallbackThe callback delegate that will receive notification when the asynchronous operation completes.
state
objectA user-defined object that will be passed to the callback delegate.
Returns
- ICancellableAsyncResult
An ICancellableAsyncResult that references the asynchronous operation.
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
AccessConditionAn AccessCondition object that represents the access conditions for the file. If
null
, no condition is used.options
FileRequestOptionsA FileRequestOptions object that specifies additional options for the request.
operationContext
OperationContextAn OperationContext object that represents the context for the current operation.
callback
AsyncCallbackThe callback delegate that will receive notification when the asynchronous operation completes.
state
objectA user-defined object that will be passed to the callback delegate.
Returns
- ICancellableAsyncResult
An ICancellableAsyncResult that references the asynchronous operation.
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
AsyncCallbackThe callback delegate that will receive notification when the asynchronous operation completes.
state
objectA user-defined object that will be passed to the callback delegate.
Returns
- ICancellableAsyncResult
An ICancellableAsyncResult that references the asynchronous operation.
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
longThe maximum size of the file, in bytes.
accessCondition
AccessConditionAn AccessCondition object that represents the access conditions for the file. If
null
, no condition is used.options
FileRequestOptionsAn FileRequestOptions object that specifies additional options for the request.
operationContext
OperationContextAn OperationContext object that represents the context for the current operation.
callback
AsyncCallbackThe callback delegate that will receive notification when the asynchronous operation completes.
state
objectA user-defined object that will be passed to the callback delegate.
Returns
- ICancellableAsyncResult
An ICancellableAsyncResult that references the asynchronous operation.
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
longThe maximum size of the file, in bytes.
callback
AsyncCallbackThe callback delegate that will receive notification when the asynchronous operation completes.
state
objectA user-defined object that will be passed to the callback delegate.
Returns
- ICancellableAsyncResult
An ICancellableAsyncResult that references the asynchronous operation.
BeginSetMetadata(AccessCondition, FileRequestOptions, OperationContext, AsyncCallback, object)
Begins an asynchronous operation to update the file's metadata.
[DoesServiceRequest]
public virtual ICancellableAsyncResult BeginSetMetadata(AccessCondition accessCondition, FileRequestOptions options, OperationContext operationContext, AsyncCallback callback, object state)
Parameters
accessCondition
AccessConditionAn AccessCondition object that represents the access conditions for the file. If
null
, no condition is used.options
FileRequestOptionsAn FileRequestOptions object that specifies additional options for the request.
operationContext
OperationContextAn OperationContext object that represents the context for the current operation.
callback
AsyncCallbackThe callback delegate that will receive notification when the asynchronous operation completes.
state
objectA user-defined object that will be passed to the callback delegate.
Returns
- ICancellableAsyncResult
An ICancellableAsyncResult that references the asynchronous operation.
BeginSetMetadata(AsyncCallback, object)
Begins an asynchronous operation to update the file's metadata.
[DoesServiceRequest]
public virtual ICancellableAsyncResult BeginSetMetadata(AsyncCallback callback, object state)
Parameters
callback
AsyncCallbackThe callback delegate that will receive notification when the asynchronous operation completes.
state
objectA user-defined object that will be passed to the callback delegate.
Returns
- ICancellableAsyncResult
An ICancellableAsyncResult that references the asynchronous operation.
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
AccessConditionAn AccessCondition object that represents the access conditions for the file. If
null
, no condition is used.options
FileRequestOptionsAn FileRequestOptions object that specifies additional options for the request.
operationContext
OperationContextAn OperationContext object that represents the context for the current operation.
callback
AsyncCallbackThe callback delegate that will receive notification when the asynchronous operation completes.
state
objectA user-defined object that will be passed to the callback delegate.
Returns
- ICancellableAsyncResult
An ICancellableAsyncResult that references the asynchronous operation.
BeginSetProperties(AsyncCallback, object)
Begins an asynchronous operation to update the file's properties.
[DoesServiceRequest]
public virtual ICancellableAsyncResult BeginSetProperties(AsyncCallback callback, object state)
Parameters
callback
AsyncCallbackThe callback delegate that will receive notification when the asynchronous operation completes.
state
objectA user-defined object that will be passed to the callback delegate.
Returns
- ICancellableAsyncResult
An ICancellableAsyncResult that references the asynchronous operation.
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
CloudBlobThe CloudBlob that is the source blob.
sourceAccessCondition
AccessConditionAn AccessCondition object that represents the access conditions for the source blob. If
null
, no condition is used.destAccessCondition
AccessConditionAn AccessCondition object that represents the access conditions for the destination file. If
null
, no condition is used.options
FileRequestOptionsA FileRequestOptions object that specifies additional options for the request.
operationContext
OperationContextAn OperationContext object that represents the context for the current operation.
callback
AsyncCallbackAn AsyncCallback delegate that will receive notification when the asynchronous operation completes.
state
objectA user-defined object that will be passed to the callback delegate.
Returns
- ICancellableAsyncResult
An ICancellableAsyncResult that references the asynchronous operation.
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
CloudBlobThe CloudBlob that is the source blob.
callback
AsyncCallbackAn AsyncCallback delegate that will receive notification when the asynchronous operation completes.
state
objectA user-defined object that will be passed to the callback delegate.
Returns
- ICancellableAsyncResult
An ICancellableAsyncResult that references the asynchronous operation.
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
CloudFileA CloudFile object.
sourceAccessCondition
AccessConditionAn AccessCondition object that represents the access conditions for the source file. If
null
, no condition is used.destAccessCondition
AccessConditionAn AccessCondition object that represents the access conditions for the destination file. If
null
, no condition is used.options
FileRequestOptionsA FileRequestOptions object that specifies additional options for the request.
operationContext
OperationContextAn OperationContext object that represents the context for the current operation.
callback
AsyncCallbackAn AsyncCallback delegate that will receive notification when the asynchronous operation completes.
state
objectA user-defined object that will be passed to the callback delegate.
Returns
- ICancellableAsyncResult
An ICancellableAsyncResult that references the asynchronous operation.
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
CloudFileA CloudFile object.
callback
AsyncCallbackAn AsyncCallback delegate that will receive notification when the asynchronous operation completes.
state
objectA user-defined object that will be passed to the callback delegate.
Returns
- ICancellableAsyncResult
An ICancellableAsyncResult that references the asynchronous operation.
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
UriThe System.Uri of the source blob or file.
sourceAccessCondition
AccessConditionAn AccessCondition object that represents the access conditions for the source object. If
null
, no condition is used.destAccessCondition
AccessConditionAn AccessCondition object that represents the access conditions for the destination file. If
null
, no condition is used.options
FileRequestOptionsA FileRequestOptions object that specifies additional options for the request.
operationContext
OperationContextAn OperationContext object that represents the context for the current operation.
callback
AsyncCallbackAn AsyncCallback delegate that will receive notification when the asynchronous operation completes.
state
objectA user-defined object that will be passed to the callback delegate.
Returns
- ICancellableAsyncResult
An ICancellableAsyncResult that references the asynchronous operation.
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
UriThe System.Uri of the source blob or file.
callback
AsyncCallbackAn AsyncCallback delegate that will receive notification when the asynchronous operation completes.
state
objectA user-defined object that will be passed to the callback delegate.
Returns
- ICancellableAsyncResult
An ICancellableAsyncResult that references the asynchronous operation.
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
intThe zero-based byte offset in buffer at which to begin uploading bytes to the file.
count
intThe number of bytes to be written to the file.
accessCondition
AccessConditionAn AccessCondition object that represents the access conditions for the file.
options
FileRequestOptionsA FileRequestOptions object that specifies additional options for the request.
operationContext
OperationContextAn OperationContext object that represents the context for the current operation.
callback
AsyncCallbackThe callback delegate that will receive notification when the asynchronous operation completes.
state
objectA user-defined object that will be passed to the callback delegate.
Returns
- ICancellableAsyncResult
An ICancellableAsyncResult that references the asynchronous operation.
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
intThe zero-based byte offset in buffer at which to begin uploading bytes to the file.
count
intThe number of bytes to be written to the file.
callback
AsyncCallbackThe callback delegate that will receive notification when the asynchronous operation completes.
state
objectA user-defined object that will be passed to the callback delegate.
Returns
- ICancellableAsyncResult
An ICancellableAsyncResult that references the asynchronous operation.
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
stringThe file providing the content.
accessCondition
AccessConditionAn AccessCondition object that represents the access conditions for the file.
options
FileRequestOptionsA FileRequestOptions object that specifies additional options for the request.
operationContext
OperationContextAn OperationContext object that represents the context for the current operation.
callback
AsyncCallbackThe callback delegate that will receive notification when the asynchronous operation completes.
state
objectA user-defined object that will be passed to the callback delegate.
Returns
- ICancellableAsyncResult
An ICancellableAsyncResult that references the asynchronous operation.
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
stringThe file providing the content.
callback
AsyncCallbackThe callback delegate that will receive notification when the asynchronous operation completes.
state
objectA user-defined object that will be passed to the callback delegate.
Returns
- ICancellableAsyncResult
An ICancellableAsyncResult that references the asynchronous operation.
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
StreamThe stream providing the file content.
accessCondition
AccessConditionAn AccessCondition object that represents the access conditions for the file. If
null
, no condition is used.options
FileRequestOptionsA FileRequestOptions object that specifies additional options for the request.
operationContext
OperationContextAn OperationContext object that represents the context for the current operation.
callback
AsyncCallbackThe callback delegate that will receive notification when the asynchronous operation completes.
state
objectA user-defined object that will be passed to the callback delegate.
Returns
- ICancellableAsyncResult
An ICancellableAsyncResult that references the asynchronous operation.
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
StreamThe stream providing the file content.
callback
AsyncCallbackThe callback delegate that will receive notification when the asynchronous operation completes.
state
objectA user-defined object that will be passed to the callback delegate.
Returns
- ICancellableAsyncResult
An ICancellableAsyncResult that references the asynchronous operation.
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
StreamThe stream providing the file content.
length
longSpecifies the number of bytes from the Stream source to upload from the start position.
accessCondition
AccessConditionAn AccessCondition object that represents the access conditions for the file. If
null
, no condition is used.options
FileRequestOptionsA FileRequestOptions object that specifies additional options for the request.
operationContext
OperationContextAn OperationContext object that represents the context for the current operation.
callback
AsyncCallbackThe callback delegate that will receive notification when the asynchronous operation completes.
state
objectA user-defined object that will be passed to the callback delegate.
Returns
- ICancellableAsyncResult
An ICancellableAsyncResult that references the asynchronous operation.
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
StreamThe stream providing the file content.
length
longSpecifies the number of bytes from the Stream source to upload from the start position.
callback
AsyncCallbackThe callback delegate that will receive notification when the asynchronous operation completes.
state
objectA user-defined object that will be passed to the callback delegate.
Returns
- ICancellableAsyncResult
An ICancellableAsyncResult that references the asynchronous operation.
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
stringThe text to upload.
callback
AsyncCallbackThe callback delegate that will receive notification when the asynchronous operation completes.
state
objectA user-defined object that will be passed to the callback delegate.
Returns
- ICancellableAsyncResult
An ICancellableAsyncResult that references the asynchronous operation.
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
stringThe text to upload.
encoding
EncodingAn object that indicates the text encoding to use. If null, UTF-8 will be used.
accessCondition
AccessConditionAn AccessCondition object that represents the access conditions for the file.
options
FileRequestOptionsA FileRequestOptions object that specifies additional options for the request.
operationContext
OperationContextAn OperationContext object that represents the context for the current operation.
callback
AsyncCallbackThe callback delegate that will receive notification when the asynchronous operation completes.
state
objectA user-defined object that will be passed to the callback delegate.
Returns
- ICancellableAsyncResult
An ICancellableAsyncResult that references the asynchronous operation.
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
StreamA stream providing the data.
startOffset
longThe offset at which to begin writing, in bytes.
contentMD5
stringAn optional hash value that will be used to set the ContentMD5 property on the file. May be
null
or an empty string.accessCondition
AccessConditionAn AccessCondition object that represents the access conditions for the file. If
null
, no condition is used.options
FileRequestOptionsA FileRequestOptions object that specifies additional options for the request.
operationContext
OperationContextAn OperationContext object that represents the context for the current operation.
callback
AsyncCallbackThe callback delegate that will receive notification when the asynchronous operation completes.
state
objectA user-defined object that will be passed to the callback delegate.
Returns
- ICancellableAsyncResult
An ICancellableAsyncResult that references the asynchronous operation.
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
StreamA stream providing the data.
startOffset
longThe offset at which to begin writing, in bytes.
contentMD5
stringAn optional hash value that will be used to set the ContentMD5 property on the file. May be
null
or an empty string.callback
AsyncCallbackThe callback delegate that will receive notification when the asynchronous operation completes.
state
objectA user-defined object that will be passed to the callback delegate.
Returns
- ICancellableAsyncResult
An ICancellableAsyncResult that references the asynchronous operation.
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
longThe offset at which to begin clearing ranges, in bytes.
length
longThe length of the range to be cleared, in bytes.
accessCondition
AccessConditionAn AccessCondition object that represents the access conditions for the file. If
null
, no condition is used.options
FileRequestOptionsAn FileRequestOptions object that specifies additional options for the request.
operationContext
OperationContextAn OperationContext object that represents the context for the current operation.
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
longThe offset at which to begin clearing ranges, in bytes.
length
longThe length of the data range to be cleared, in bytes.
Returns
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
longThe offset at which to begin clearing ranges, in bytes.
length
longThe length of the data range to be cleared, in bytes.
accessCondition
AccessConditionAn AccessCondition object that represents the access conditions for the file. If
null
, no condition is used.options
FileRequestOptionsA FileRequestOptions object that specifies additional options for the request.
operationContext
OperationContextAn OperationContext object that represents the context for the current operation.
Returns
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
longThe offset at which to begin clearing ranges, in bytes.
length
longThe length of the data range to be cleared, in bytes.
accessCondition
AccessConditionAn AccessCondition object that represents the access conditions for the file. If
null
, no condition is used.options
FileRequestOptionsA FileRequestOptions object that specifies additional options for the request.
operationContext
OperationContextAn OperationContext object that represents the context for the current operation.
cancellationToken
CancellationTokenA CancellationToken to observe while waiting for a task to complete.
Returns
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
longThe offset at which to begin clearing ranges, in bytes.
length
longThe length of the data range to be cleared, in bytes.
cancellationToken
CancellationTokenA CancellationToken to observe while waiting for a task to complete.
Returns
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
longThe maximum size of the file, in bytes.
accessCondition
AccessConditionAn AccessCondition object that represents the access conditions for the file. If
null
, no condition is used.options
FileRequestOptionsA FileRequestOptions object that specifies additional options for the request.
operationContext
OperationContextAn OperationContext object that represents the context for the current operation.
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
longThe maximum size of the file, in bytes.
Returns
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
longThe maximum size of the file, in bytes.
accessCondition
AccessConditionAn AccessCondition object that represents the access conditions for the file. If
null
, no condition is used.options
FileRequestOptionsA FileRequestOptions object that specifies additional options for the request.
operationContext
OperationContextAn OperationContext object that represents the context for the current operation.
Returns
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
longThe maximum size of the file, in bytes.
accessCondition
AccessConditionAn AccessCondition object that represents the access conditions for the file. If
null
, no condition is used.options
FileRequestOptionsA FileRequestOptions object that specifies additional options for the request.
operationContext
OperationContextAn OperationContext object that represents the context for the current operation.
cancellationToken
CancellationTokenA CancellationToken to observe while waiting for a task to complete.
Returns
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
longThe maximum size of the file, in bytes.
cancellationToken
CancellationTokenA CancellationToken to observe while waiting for a task to complete.
Returns
Delete(AccessCondition, FileRequestOptions, OperationContext)
Deletes the file.
[DoesServiceRequest]
public virtual void Delete(AccessCondition accessCondition = null, FileRequestOptions options = null, OperationContext operationContext = null)
Parameters
accessCondition
AccessConditionAn AccessCondition object that represents the access conditions for the file. If
null
, no condition is used.options
FileRequestOptionsA FileRequestOptions object that specifies additional options for the request.
operationContext
OperationContextAn OperationContext object that represents the context for the current operation.
DeleteAsync()
Returns a task that performs an asynchronous operation to delete the file.
[DoesServiceRequest]
public virtual Task DeleteAsync()
Returns
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
AccessConditionAn AccessCondition object that represents the access conditions for the file. If
null
, no condition is used.options
FileRequestOptionsA FileRequestOptions object that specifies additional options for the request.
operationContext
OperationContextAn OperationContext object that represents the context for the current operation.
Returns
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
AccessConditionAn AccessCondition object that represents the access conditions for the file. If
null
, no condition is used.options
FileRequestOptionsA FileRequestOptions object that specifies additional options for the request.
operationContext
OperationContextAn OperationContext object that represents the context for the current operation.
cancellationToken
CancellationTokenA CancellationToken to observe while waiting for a task to complete.
Returns
DeleteAsync(CancellationToken)
Returns a task that performs an asynchronous operation to delete the file.
[DoesServiceRequest]
public virtual Task DeleteAsync(CancellationToken cancellationToken)
Parameters
cancellationToken
CancellationTokenA CancellationToken to observe while waiting for a task to complete.
Returns
DeleteIfExists(AccessCondition, FileRequestOptions, OperationContext)
Deletes the file if it already exists.
[DoesServiceRequest]
public virtual bool DeleteIfExists(AccessCondition accessCondition = null, FileRequestOptions options = null, OperationContext operationContext = null)
Parameters
accessCondition
AccessConditionAn AccessCondition object that represents the access conditions for the file. If
null
, no condition is used.options
FileRequestOptionsA FileRequestOptions object that specifies additional options for the request.
operationContext
OperationContextAn OperationContext object that represents the context for the current operation.
Returns
- bool
true
if the file did already exist and was deleted; otherwisefalse
.
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
AccessConditionAn AccessCondition object that represents the access conditions for the file. If
null
, no condition is used.options
FileRequestOptionsA FileRequestOptions object that specifies additional options for the request.
operationContext
OperationContextAn OperationContext object that represents the context for the current operation.
Returns
- 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
AccessConditionAn AccessCondition object that represents the access conditions for the file. If
null
, no condition is used.options
FileRequestOptionsA FileRequestOptions object that specifies additional options for the request.
operationContext
OperationContextAn OperationContext object that represents the context for the current operation.
cancellationToken
CancellationTokenA CancellationToken to observe while waiting for a task to complete.
Returns
- 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
CancellationTokenA 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
intThe 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
AccessConditionAn AccessCondition object that represents the access conditions for the file.
options
FileRequestOptionsA FileRequestOptions object that specifies additional options for the request.
operationContext
OperationContextAn 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
intThe 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
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
intThe 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
AccessConditionAn AccessCondition object that represents the access conditions for the file.
options
FileRequestOptionsAn FileRequestOptions object that specifies additional options for the request.
operationContext
OperationContextAn OperationContext object that represents the context for the current operation.
Returns
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
intThe 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
AccessConditionAn AccessCondition object that represents the access conditions for the file.
options
FileRequestOptionsAn FileRequestOptions object that specifies additional options for the request.
operationContext
OperationContextAn OperationContext object that represents the context for the current operation.
progressHandler
IProgress<StorageProgress>A IProgress<T> object to handle StorageProgress messages.
cancellationToken
CancellationTokenA CancellationToken to observe while waiting for a task to complete.
Returns
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
intThe 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
AccessConditionAn AccessCondition object that represents the access conditions for the file.
options
FileRequestOptionsAn FileRequestOptions object that specifies additional options for the request.
operationContext
OperationContextAn OperationContext object that represents the context for the current operation.
cancellationToken
CancellationTokenA CancellationToken to observe while waiting for a task to complete.
Returns
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
intThe 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
CancellationTokenA CancellationToken to observe while waiting for a task to complete.
Returns
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
StreamThe target stream.
offset
long?The starting offset of the data range, in bytes.
length
long?The length of the data range, in bytes.
accessCondition
AccessConditionAn AccessCondition object that represents the access conditions for the file. If
null
, no condition is used.options
FileRequestOptionsA FileRequestOptions object that specifies additional options for the request.
operationContext
OperationContextAn OperationContext object that represents the context for the current operation.
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
StreamThe target stream.
offset
long?The starting offset of the data range, in bytes.
length
long?The length of the data range, in bytes.
Returns
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
StreamThe target stream.
offset
long?The starting offset of the data range, in bytes.
length
long?The length of the data range, in bytes.
accessCondition
AccessConditionAn AccessCondition object that represents the access conditions for the file. If
null
, no condition is used.options
FileRequestOptionsA FileRequestOptions object that specifies additional options for the request.
operationContext
OperationContextAn OperationContext object that represents the context for the current operation.
Returns
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
StreamThe target stream.
offset
long?The starting offset of the data range, in bytes.
length
long?The length of the data range, in bytes.
accessCondition
AccessConditionAn AccessCondition object that represents the access conditions for the file. If
null
, no condition is used.options
FileRequestOptionsA FileRequestOptions object that specifies additional options for the request.
operationContext
OperationContextAn OperationContext object that represents the context for the current operation.
progressHandler
IProgress<StorageProgress>A IProgress<T> object to handle StorageProgress messages.
cancellationToken
CancellationTokenA CancellationToken to observe while waiting for a task to complete.
Returns
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
StreamThe target stream.
offset
long?The starting offset of the data range, in bytes.
length
long?The length of the data range, in bytes.
accessCondition
AccessConditionAn AccessCondition object that represents the access conditions for the file. If
null
, no condition is used.options
FileRequestOptionsA FileRequestOptions object that specifies additional options for the request.
operationContext
OperationContextAn OperationContext object that represents the context for the current operation.
cancellationToken
CancellationTokenA CancellationToken to observe while waiting for a task to complete.
Returns
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
StreamThe target stream.
offset
long?The starting offset of the data range, in bytes.
length
long?The length of the data range, in bytes.
cancellationToken
CancellationTokenA CancellationToken to observe while waiting for a task to complete.
Returns
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
EncodingA Encoding object that indicates the type of text encoding to use.
accessCondition
AccessConditionAn AccessCondition object that represents the access conditions for the file.
options
FileRequestOptionsA FileRequestOptions object that specifies additional options for the request.
operationContext
OperationContextAn 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
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
EncodingA Encoding object that indicates the type of text encoding to use.
accessCondition
AccessConditionAn AccessCondition object that represents the access conditions for the file.
options
FileRequestOptionsAn FileRequestOptions object that specifies additional options for the request.
operationContext
OperationContextAn OperationContext object that represents the context for the current operation.
Returns
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
EncodingA Encoding object that indicates the type of text encoding to use.
accessCondition
AccessConditionAn AccessCondition object that represents the access conditions for the file.
options
FileRequestOptionsAn FileRequestOptions object that specifies additional options for the request.
operationContext
OperationContextAn OperationContext object that represents the context for the current operation.
progressHandler
IProgress<StorageProgress>A IProgress<T> object to handle StorageProgress messages.
cancellationToken
CancellationTokenA CancellationToken to observe while waiting for a task to complete.
Returns
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
EncodingA Encoding object that indicates the type of text encoding to use.
accessCondition
AccessConditionAn AccessCondition object that represents the access conditions for the file.
options
FileRequestOptionsAn FileRequestOptions object that specifies additional options for the request.
operationContext
OperationContextAn OperationContext object that represents the context for the current operation.
cancellationToken
CancellationTokenA CancellationToken to observe while waiting for a task to complete.
Returns
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
CancellationTokenA CancellationToken to observe while waiting for a task to complete.
Returns
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
intThe starting offset in the byte array.
accessCondition
AccessConditionAn AccessCondition object that represents the access conditions for the file.
options
FileRequestOptionsA FileRequestOptions object that specifies additional options for the request.
operationContext
OperationContextAn 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
Returns
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
intThe starting offset in the byte array.
accessCondition
AccessConditionAn AccessCondition object that represents the access conditions for the file.
options
FileRequestOptionsAn FileRequestOptions object that specifies additional options for the request.
operationContext
OperationContextAn OperationContext object that represents the context for the current operation.
Returns
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
intThe starting offset in the byte array.
accessCondition
AccessConditionAn AccessCondition object that represents the access conditions for the file.
options
FileRequestOptionsAn FileRequestOptions object that specifies additional options for the request.
operationContext
OperationContextAn OperationContext object that represents the context for the current operation.
progressHandler
IProgress<StorageProgress>A IProgress<T> object to handle StorageProgress messages.
cancellationToken
CancellationTokenA CancellationToken to observe while waiting for a task to complete.
Returns
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
intThe starting offset in the byte array.
accessCondition
AccessConditionAn AccessCondition object that represents the access conditions for the file.
options
FileRequestOptionsAn FileRequestOptions object that specifies additional options for the request.
operationContext
OperationContextAn OperationContext object that represents the context for the current operation.
cancellationToken
CancellationTokenA CancellationToken to observe while waiting for a task to complete.
Returns
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
intThe starting offset in the byte array.
cancellationToken
CancellationTokenA CancellationToken to observe while waiting for a task to complete.
Returns
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
stringThe path to the target file in the local file system.
mode
FileModeA FileMode enumeration value that determines how to open or create the file.
accessCondition
AccessConditionAn AccessCondition object that represents the access conditions for the file.
options
FileRequestOptionsA FileRequestOptions object that specifies additional options for the request.
operationContext
OperationContextAn 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
stringThe path to the target file in the local file system.
mode
FileModeA FileMode enumeration value that determines how to open or create the file.
Returns
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
stringThe path to the target file in the local file system.
mode
FileModeA FileMode enumeration value that determines how to open or create the file.
accessCondition
AccessConditionAn AccessCondition object that represents the access conditions for the cloud file.
options
FileRequestOptionsAn FileRequestOptions object that specifies additional options for the request.
operationContext
OperationContextAn OperationContext object that represents the context for the current operation.
Returns
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
stringThe path to the target file in the local file system.
mode
FileModeA FileMode enumeration value that determines how to open or create the file.
accessCondition
AccessConditionAn AccessCondition object that represents the access conditions for the cloud file.
options
FileRequestOptionsAn FileRequestOptions object that specifies additional options for the request.
operationContext
OperationContextAn OperationContext object that represents the context for the current operation.
progressHandler
IProgress<StorageProgress>A IProgress<T> object to handle StorageProgress messages.
cancellationToken
CancellationTokenA CancellationToken to observe while waiting for a task to complete.
Returns
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
stringThe path to the target file in the local file system.
mode
FileModeA FileMode enumeration value that determines how to open or create the file.
accessCondition
AccessConditionAn AccessCondition object that represents the access conditions for the cloud file.
options
FileRequestOptionsAn FileRequestOptions object that specifies additional options for the request.
operationContext
OperationContextAn OperationContext object that represents the context for the current operation.
cancellationToken
CancellationTokenA CancellationToken to observe while waiting for a task to complete.
Returns
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
stringThe path to the target file in the local file system.
mode
FileModeA FileMode enumeration value that determines how to open or create the file.
cancellationToken
CancellationTokenA CancellationToken to observe while waiting for a task to complete.
Returns
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
StreamThe target stream.
accessCondition
AccessConditionAn AccessCondition object that represents the access conditions for the file. If
null
, no condition is used.options
FileRequestOptionsA FileRequestOptions object that specifies additional options for the request.
operationContext
OperationContextAn OperationContext object that represents the context for the current operation.
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
StreamThe target stream.
Returns
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
StreamThe target stream.
accessCondition
AccessConditionAn AccessCondition object that represents the access conditions for the file. If
null
, no condition is used.options
FileRequestOptionsA FileRequestOptions object that specifies additional options for the request.
operationContext
OperationContextAn OperationContext object that represents the context for the current operation.
Returns
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
StreamThe target stream.
accessCondition
AccessConditionAn AccessCondition object that represents the access conditions for the file. If
null
, no condition is used.options
FileRequestOptionsA FileRequestOptions object that specifies additional options for the request.
operationContext
OperationContextAn OperationContext object that represents the context for the current operation.
progressHandler
IProgress<StorageProgress>A IProgress<T> object to handle StorageProgress messages.
cancellationToken
CancellationTokenA CancellationToken to observe while waiting for a task to complete.
Returns
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
StreamThe target stream.
accessCondition
AccessConditionAn AccessCondition object that represents the access conditions for the file. If
null
, no condition is used.options
FileRequestOptionsA FileRequestOptions object that specifies additional options for the request.
operationContext
OperationContextAn OperationContext object that represents the context for the current operation.
cancellationToken
CancellationTokenA CancellationToken to observe while waiting for a task to complete.
Returns
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
StreamThe target stream.
cancellationToken
CancellationTokenA CancellationToken to observe while waiting for a task to complete.
Returns
EndAbortCopy(IAsyncResult)
Ends an asynchronous operation to abort an ongoing copy operation.
public virtual void EndAbortCopy(IAsyncResult asyncResult)
Parameters
asyncResult
IAsyncResultAn 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
IAsyncResultAn 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
IAsyncResultAn 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
IAsyncResultAn 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
IAsyncResultAn 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
IAsyncResultAn 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
IAsyncResultAn 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
IAsyncResultAn 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
IAsyncResultAn 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
IAsyncResultAn 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
IAsyncResultAn 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
IAsyncResultAn 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
IAsyncResultAn 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
IAsyncResultAn 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
IAsyncResultAn 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
IAsyncResultAn 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
IAsyncResultAn 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
IAsyncResultAn 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
IAsyncResultAn 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
IAsyncResultAn 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
IAsyncResultAn 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
IAsyncResultAn 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
IAsyncResultAn 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
IAsyncResultAn 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
IAsyncResultAn 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
FileRequestOptionsA FileRequestOptions object that specifies additional options for the request.
operationContext
OperationContextAn OperationContext object that represents the context for the current operation.
Returns
- bool
true
if the 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
FileRequestOptionsA FileRequestOptions object that specifies additional options for the request.
operationContext
OperationContextAn OperationContext object that represents the context for the current operation.
Returns
- Task<bool>
A Task<TResult> object that represents the current operation.
ExistsAsync(FileRequestOptions, OperationContext, CancellationToken)
Returns a task that performs an asynchronous request to check existence of the file.
[DoesServiceRequest]
public virtual Task<bool> ExistsAsync(FileRequestOptions options, OperationContext operationContext, CancellationToken cancellationToken)
Parameters
options
FileRequestOptionsA FileRequestOptions object that specifies additional options for the request.
operationContext
OperationContextAn OperationContext object that represents the context for the current operation.
cancellationToken
CancellationTokenA CancellationToken to observe while waiting for a task to complete.
Returns
- Task<bool>
A Task<TResult> object that represents the current operation.
ExistsAsync(CancellationToken)
Returns a task that performs an asynchronous request to check existence of the file.
[DoesServiceRequest]
public virtual Task<bool> ExistsAsync(CancellationToken cancellationToken)
Parameters
cancellationToken
CancellationTokenA CancellationToken to observe while waiting for a task to complete.
Returns
- Task<bool>
A Task<TResult> object that represents the current operation.
FetchAttributes(AccessCondition, FileRequestOptions, OperationContext)
Populates a file's properties and metadata.
[DoesServiceRequest]
public virtual void FetchAttributes(AccessCondition accessCondition = null, FileRequestOptions options = null, OperationContext operationContext = null)
Parameters
accessCondition
AccessConditionAn AccessCondition object that represents the access conditions for the file. If
null
, no condition is used.options
FileRequestOptionsA FileRequestOptions object that specifies additional options for the request.
operationContext
OperationContextAn OperationContext object that represents the context for the current operation.
FetchAttributesAsync()
Returns a task that performs an asynchronous operation to populate the file's properties and metadata.
[DoesServiceRequest]
public virtual Task FetchAttributesAsync()
Returns
FetchAttributesAsync(AccessCondition, FileRequestOptions, OperationContext)
Returns a task that performs an asynchronous operation to populate the file's properties and metadata.
[DoesServiceRequest]
public virtual Task FetchAttributesAsync(AccessCondition accessCondition, FileRequestOptions options, OperationContext operationContext)
Parameters
accessCondition
AccessConditionAn AccessCondition object that represents the access conditions for the file. If
null
, no condition is used.options
FileRequestOptionsA FileRequestOptions object that specifies additional options for the request.
operationContext
OperationContextAn OperationContext object that represents the context for the current operation.
Returns
FetchAttributesAsync(AccessCondition, FileRequestOptions, OperationContext, CancellationToken)
Returns a task that performs an asynchronous operation to populate the file's properties and metadata.
[DoesServiceRequest]
public virtual Task FetchAttributesAsync(AccessCondition accessCondition, FileRequestOptions options, OperationContext operationContext, CancellationToken cancellationToken)
Parameters
accessCondition
AccessConditionAn AccessCondition object that represents the access conditions for the file. If
null
, no condition is used.options
FileRequestOptionsA FileRequestOptions object that specifies additional options for the request.
operationContext
OperationContextAn OperationContext object that represents the context for the current operation.
cancellationToken
CancellationTokenA CancellationToken to observe while waiting for a task to complete.
Returns
FetchAttributesAsync(CancellationToken)
Returns a task that performs an asynchronous operation to populate the file's properties and metadata.
[DoesServiceRequest]
public virtual Task FetchAttributesAsync(CancellationToken cancellationToken)
Parameters
cancellationToken
CancellationTokenA CancellationToken to observe while waiting for a task to complete.
Returns
GetSharedAccessSignature(SharedAccessFilePolicy)
Returns a shared access signature for the file.
public string GetSharedAccessSignature(SharedAccessFilePolicy policy)
Parameters
policy
SharedAccessFilePolicyA 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
SharedAccessFilePolicyA SharedAccessFilePolicy object specifying the access policy for the shared access signature.
headers
SharedAccessFileHeadersA 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
SharedAccessFilePolicyA SharedAccessFilePolicy object specifying the access policy for the shared access signature.
headers
SharedAccessFileHeadersA SharedAccessFileHeaders object specifying optional header values to set for a file accessed with this SAS.
groupPolicyIdentifier
stringA 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
SharedAccessFilePolicyA SharedAccessFilePolicy object specifying the access policy for the shared access signature.
headers
SharedAccessFileHeadersA SharedAccessFileHeaders object specifying optional header values to set for a file accessed with this SAS.
groupPolicyIdentifier
stringA 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
IPAddressOrRangeThe 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
SharedAccessFilePolicyA SharedAccessFilePolicy object specifying the access policy for the shared access signature.
groupPolicyIdentifier
stringA 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
AccessConditionAn AccessCondition object that represents the access conditions for the file. If
null
, no condition is used.options
FileRequestOptionsA FileRequestOptions object that specifies additional options for the request.
operationContext
OperationContextAn OperationContext object that represents the context for the current operation.
Returns
- 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
AccessConditionAn AccessCondition object that represents the access conditions for the file. If
null
, no condition is used.options
FileRequestOptionsA FileRequestOptions object that specifies additional options for the request.
operationContext
OperationContextAn OperationContext object that represents the context for the current operation.
Returns
- 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
AccessConditionAn AccessCondition object that represents the access conditions for the file. If
null
, no condition is used.options
FileRequestOptionsA FileRequestOptions object that specifies additional options for the request.
operationContext
OperationContextAn OperationContext object that represents the context for the current operation.
cancellationToken
CancellationTokenA CancellationToken to observe while waiting for a task to complete.
Returns
- 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
CancellationTokenA 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
AccessConditionAn AccessCondition object that represents the access conditions for the file. If
null
, no condition is used.options
FileRequestOptionsA FileRequestOptions object that specifies additional options for the request.
operationContext
OperationContextAn OperationContext object that represents the context for the current operation.
Returns
- 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
AccessConditionAn AccessCondition object that represents the access conditions for the file. If
null
, no condition is used.options
FileRequestOptionsA FileRequestOptions object that specifies additional options for the request.
operationContext
OperationContextAn OperationContext object that represents the context for the current operation.
Returns
- 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
AccessConditionAn AccessCondition object that represents the access conditions for the file. If
null
, no condition is used.options
FileRequestOptionsA FileRequestOptions object that specifies additional options for the request.
operationContext
OperationContextAn OperationContext object that represents the context for the current operation.
cancellationToken
CancellationTokenA CancellationToken to observe while waiting for a task to complete.
Returns
- 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
CancellationTokenA 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
AccessConditionAn AccessCondition object that represents the access conditions for the file. If
null
, no condition is used.options
FileRequestOptionsA FileRequestOptions object that specifies additional options for the request.
operationContext
OperationContextAn OperationContext object that represents the context for the current operation.
Returns
- 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
AccessConditionAn AccessCondition object that represents the access conditions for the file. If
null
, no condition is used.options
FileRequestOptionsA FileRequestOptions object that specifies additional options for the request.
operationContext
OperationContextAn OperationContext object that represents the context for the current operation.
Returns
- 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
AccessConditionAn AccessCondition object that represents the access conditions for the file. If
null
, no condition is used.options
FileRequestOptionsA FileRequestOptions object that specifies additional options for the request.
operationContext
OperationContextAn OperationContext object that represents the context for the current operation.
cancellationToken
CancellationTokenA CancellationToken to observe while waiting for a task to complete.
Returns
- 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
CancellationTokenA 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
longThe maximum size of the file, in bytes.
accessCondition
AccessConditionAn AccessCondition object that represents the access conditions for the file. If
null
, no condition is used.options
FileRequestOptionsAn FileRequestOptions object that specifies additional options for the request.
operationContext
OperationContextAn OperationContext object that represents the context for the current operation.
ResizeAsync(long)
Returns a task that performs an asynchronous operation to resize a file.
[DoesServiceRequest]
public virtual Task ResizeAsync(long size)
Parameters
size
longThe maximum size of the file, in bytes.
Returns
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
longThe maximum size of the file, in bytes.
accessCondition
AccessConditionAn AccessCondition object that represents the access conditions for the file. If
null
, no condition is used.options
FileRequestOptionsA FileRequestOptions object that specifies additional options for the request.
operationContext
OperationContextAn OperationContext object that represents the context for the current operation.
Returns
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
longThe maximum size of the file, in bytes.
accessCondition
AccessConditionAn AccessCondition object that represents the access conditions for the file. If
null
, no condition is used.options
FileRequestOptionsA FileRequestOptions object that specifies additional options for the request.
operationContext
OperationContextAn OperationContext object that represents the context for the current operation.
cancellationToken
CancellationTokenA CancellationToken to observe while waiting for a task to complete.
Returns
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
longThe maximum size of the file, in bytes.
cancellationToken
CancellationTokenA CancellationToken to observe while waiting for a task to complete.
Returns
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
AccessConditionAn AccessCondition object that represents the access conditions for the file. If
null
, no condition is used.options
FileRequestOptionsAn FileRequestOptions object that specifies additional options for the request.
operationContext
OperationContextAn OperationContext object that represents the context for the current operation.
SetMetadataAsync()
Returns a task that performs an asynchronous operation to update the file's metadata.
[DoesServiceRequest]
public virtual Task SetMetadataAsync()
Returns
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
AccessConditionAn AccessCondition object that represents the access conditions for the file. If
null
, no condition is used.options
FileRequestOptionsA FileRequestOptions object that specifies additional options for the request.
operationContext
OperationContextAn OperationContext object that represents the context for the current operation.
Returns
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
AccessConditionAn AccessCondition object that represents the access conditions for the file. If
null
, no condition is used.options
FileRequestOptionsA FileRequestOptions object that specifies additional options for the request.
operationContext
OperationContextAn OperationContext object that represents the context for the current operation.
cancellationToken
CancellationTokenA CancellationToken to observe while waiting for a task to complete.
Returns
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
CancellationTokenA CancellationToken to observe while waiting for a task to complete.
Returns
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
AccessConditionAn AccessCondition object that represents the access conditions for the file. If
null
, no condition is used.options
FileRequestOptionsAn FileRequestOptions object that specifies additional options for the request.
operationContext
OperationContextAn OperationContext object that represents the context for the current operation.
SetPropertiesAsync()
Returns a task that performs an asynchronous operation to update the file's properties.
[DoesServiceRequest]
public virtual Task SetPropertiesAsync()
Returns
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
AccessConditionAn AccessCondition object that represents the access conditions for the file. If
null
, no condition is used.options
FileRequestOptionsA FileRequestOptions object that specifies additional options for the request.
operationContext
OperationContextAn OperationContext object that represents the context for the current operation.
Returns
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
AccessConditionAn AccessCondition object that represents the access conditions for the file. If
null
, no condition is used.options
FileRequestOptionsA FileRequestOptions object that specifies additional options for the request.
operationContext
OperationContextAn OperationContext object that represents the context for the current operation.
cancellationToken
CancellationTokenA CancellationToken to observe while waiting for a task to complete.
Returns
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
CancellationTokenA CancellationToken to observe while waiting for a task to complete.
Returns
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
CloudBlobThe CloudBlob of the source blob.
sourceAccessCondition
AccessConditionAn AccessCondition object that represents the access conditions for the source blob. If
null
, no condition is used.destAccessCondition
AccessConditionAn AccessCondition object that represents the access conditions for the destination file. If
null
, no condition is used.options
FileRequestOptionsA FileRequestOptions object that specifies additional options for the request. If
null
, default options are applied to the request.operationContext
OperationContextAn OperationContext object that represents the context for the current operation.
Returns
- 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
CloudFileA CloudFile object.
sourceAccessCondition
AccessConditionAn AccessCondition object that represents the access conditions for the source file. If
null
, no condition is used.destAccessCondition
AccessConditionAn AccessCondition object that represents the access conditions for the destination file. If
null
, no condition is used.options
FileRequestOptionsA FileRequestOptions object that specifies additional options for the request. If
null
, default options are applied to the request.operationContext
OperationContextAn OperationContext object that represents the context for the current operation.
Returns
- 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
UriThe System.Uri of the source blob or file.
sourceAccessCondition
AccessConditionAn AccessCondition object that represents the access conditions for the source object. If
null
, no condition is used.destAccessCondition
AccessConditionAn AccessCondition object that represents the access conditions for the destination file. If
null
, no condition is used.options
FileRequestOptionsA FileRequestOptions object that specifies additional options for the request. If
null
, default options are applied to the request.operationContext
OperationContextAn OperationContext object that represents the context for the current operation.
Returns
- 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
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
CloudBlobThe CloudBlob that is the source blob.
sourceAccessCondition
AccessConditionAn AccessCondition object that represents the access conditions for the source blob. If
null
, no condition is used.destAccessCondition
AccessConditionAn AccessCondition object that represents the access conditions for the destination file. If
null
, no condition is used.options
FileRequestOptionsA FileRequestOptions object that specifies additional options for the request.
operationContext
OperationContextAn OperationContext object that represents the context for the current operation.
Returns
- 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
CloudBlobThe CloudBlob that is the source blob.
sourceAccessCondition
AccessConditionAn AccessCondition object that represents the access conditions for the source blob. If
null
, no condition is used.destAccessCondition
AccessConditionAn AccessCondition object that represents the access conditions for the destination file. If
null
, no condition is used.options
FileRequestOptionsA FileRequestOptions object that specifies additional options for the request.
operationContext
OperationContextAn OperationContext object that represents the context for the current operation.
cancellationToken
CancellationTokenA CancellationToken to observe while waiting for a task to complete.
Returns
- 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
CloudBlobThe CloudBlob that is the source blob.
cancellationToken
CancellationTokenA 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
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
CloudFileA CloudFile object.
sourceAccessCondition
AccessConditionAn AccessCondition object that represents the access conditions for the source file. If
null
, no condition is used.destAccessCondition
AccessConditionAn AccessCondition object that represents the access conditions for the destination file. If
null
, no condition is used.options
FileRequestOptionsA FileRequestOptions object that specifies additional options for the request.
operationContext
OperationContextAn OperationContext object that represents the context for the current operation.
Returns
- 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
CloudFileA CloudFile object.
sourceAccessCondition
AccessConditionAn AccessCondition object that represents the access conditions for the source file. If
null
, no condition is used.destAccessCondition
AccessConditionAn AccessCondition object that represents the access conditions for the destination file. If
null
, no condition is used.options
FileRequestOptionsA FileRequestOptions object that specifies additional options for the request.
operationContext
OperationContextAn OperationContext object that represents the context for the current operation.
cancellationToken
CancellationTokenA CancellationToken to observe while waiting for a task to complete.
Returns
- 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
CloudFileA CloudFile object.
cancellationToken
CancellationTokenA 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
UriThe 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
UriThe System.Uri of the source blob or file.
sourceAccessCondition
AccessConditionAn AccessCondition object that represents the access conditions for the source object. If
null
, no condition is used.destAccessCondition
AccessConditionAn AccessCondition object that represents the access conditions for the destination file. If
null
, no condition is used.options
FileRequestOptionsA FileRequestOptions object that specifies additional options for the request.
operationContext
OperationContextAn OperationContext object that represents the context for the current operation.
Returns
- 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
UriThe System.Uri of the source blob or file.
sourceAccessCondition
AccessConditionAn AccessCondition object that represents the access conditions for the source object. If
null
, no condition is used.destAccessCondition
AccessConditionAn AccessCondition object that represents the access conditions for the destination file. If
null
, no condition is used.options
FileRequestOptionsA FileRequestOptions object that specifies additional options for the request.
operationContext
OperationContextAn OperationContext object that represents the context for the current operation.
cancellationToken
CancellationTokenA CancellationToken to observe while waiting for a task to complete.
Returns
- 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
UriThe System.Uri of the source blob or file.
cancellationToken
CancellationTokenA 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
intThe zero-based byte offset in buffer at which to begin uploading bytes to the file.
count
intThe number of bytes to be written to the file.
accessCondition
AccessConditionAn AccessCondition object that represents the access conditions for the file.
options
FileRequestOptionsA FileRequestOptions object that specifies additional options for the request.
operationContext
OperationContextAn 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
intThe zero-based byte offset in buffer at which to begin uploading bytes to the file.
count
intThe number of bytes to be written to the file.
Returns
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
intThe zero-based byte offset in buffer at which to begin uploading bytes to the file.
count
intThe number of bytes to be written to the file.
accessCondition
AccessConditionAn AccessCondition object that represents the access conditions for the file.
options
FileRequestOptionsAn FileRequestOptions object that specifies additional options for the request.
operationContext
OperationContextAn OperationContext object that represents the context for the current operation.
Returns
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
intThe zero-based byte offset in buffer at which to begin uploading bytes to the file.
count
intThe number of bytes to be written to the file.
accessCondition
AccessConditionAn AccessCondition object that represents the access conditions for the file.
options
FileRequestOptionsAn FileRequestOptions object that specifies additional options for the request.
operationContext
OperationContextAn OperationContext object that represents the context for the current operation.
progressHandler
IProgress<StorageProgress>A IProgress<T> object to handle StorageProgress messages.
cancellationToken
CancellationTokenA CancellationToken to observe while waiting for a task to complete.
Returns
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
intThe zero-based byte offset in buffer at which to begin uploading bytes to the file.
count
intThe number of bytes to be written to the file.
accessCondition
AccessConditionAn AccessCondition object that represents the access conditions for the file.
options
FileRequestOptionsAn FileRequestOptions object that specifies additional options for the request.
operationContext
OperationContextAn OperationContext object that represents the context for the current operation.
cancellationToken
CancellationTokenA CancellationToken to observe while waiting for a task to complete.
Returns
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
intThe zero-based byte offset in buffer at which to begin uploading bytes to the file.
count
intThe number of bytes to be written to the file.
cancellationToken
CancellationTokenA CancellationToken to observe while waiting for a task to complete.
Returns
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
stringThe file providing the content.
accessCondition
AccessConditionAn AccessCondition object that represents the access conditions for the file.
options
FileRequestOptionsA FileRequestOptions object that specifies additional options for the request.
operationContext
OperationContextAn 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
stringThe file providing the file content.
Returns
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
stringThe file providing the file content.
accessCondition
AccessConditionAn AccessCondition object that represents the access conditions for the file.
options
FileRequestOptionsAn FileRequestOptions object that specifies additional options for the request.
operationContext
OperationContextAn OperationContext object that represents the context for the current operation.
Returns
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
stringThe file providing the file content.
accessCondition
AccessConditionAn AccessCondition object that represents the access conditions for the file.
options
FileRequestOptionsAn FileRequestOptions object that specifies additional options for the request.
operationContext
OperationContextAn OperationContext object that represents the context for the current operation.
progressHandler
IProgress<StorageProgress>A IProgress<T> object to handle StorageProgress messages.
cancellationToken
CancellationTokenA CancellationToken to observe while waiting for a task to complete.
Returns
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
stringThe file providing the file content.
accessCondition
AccessConditionAn AccessCondition object that represents the access conditions for the file.
options
FileRequestOptionsAn FileRequestOptions object that specifies additional options for the request.
operationContext
OperationContextAn OperationContext object that represents the context for the current operation.
cancellationToken
CancellationTokenA CancellationToken to observe while waiting for a task to complete.
Returns
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
stringThe file providing the file content.
cancellationToken
CancellationTokenA CancellationToken to observe while waiting for a task to complete.
Returns
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
StreamThe stream providing the file content.
accessCondition
AccessConditionAn AccessCondition object that represents the access conditions for the file. If
null
, no condition is used.options
FileRequestOptionsA FileRequestOptions object that specifies additional options for the request.
operationContext
OperationContextAn OperationContext object that represents the context for the current operation.
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
StreamThe stream providing the file content.
length
longThe number of bytes to write from the source stream at its current position.
accessCondition
AccessConditionAn AccessCondition object that represents the access conditions for the file. If
null
, no condition is used.options
FileRequestOptionsA FileRequestOptions object that specifies additional options for the request.
operationContext
OperationContextAn OperationContext object that represents the context for the current operation.
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
StreamThe stream providing the file content.
Returns
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
StreamThe stream providing the file content.
accessCondition
AccessConditionAn AccessCondition object that represents the access conditions for the file. If
null
, no condition is used.options
FileRequestOptionsA FileRequestOptions object that specifies additional options for the request.
operationContext
OperationContextAn OperationContext object that represents the context for the current operation.
Returns
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
StreamThe stream providing the file content.
accessCondition
AccessConditionAn AccessCondition object that represents the access conditions for the file. If
null
, no condition is used.options
FileRequestOptionsA FileRequestOptions object that specifies additional options for the request.
operationContext
OperationContextAn OperationContext object that represents the context for the current operation.
progressHandler
IProgress<StorageProgress>A IProgress<T> object to handle StorageProgress messages.
cancellationToken
CancellationTokenA CancellationToken to observe while waiting for a task to complete.
Returns
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
StreamThe stream providing the file content.
accessCondition
AccessConditionAn AccessCondition object that represents the access conditions for the file. If
null
, no condition is used.options
FileRequestOptionsA FileRequestOptions object that specifies additional options for the request.
operationContext
OperationContextAn OperationContext object that represents the context for the current operation.
cancellationToken
CancellationTokenA CancellationToken to observe while waiting for a task to complete.
Returns
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
StreamThe stream providing the file content.
length
longThe number of bytes to write from the source stream at its current position.
Returns
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
StreamThe stream providing the file content.
length
longThe number of bytes to write from the source stream at its current position.
accessCondition
AccessConditionAn AccessCondition object that represents the access conditions for the file. If
null
, no condition is used.options
FileRequestOptionsAn FileRequestOptions object that specifies additional options for the request.
operationContext
OperationContextAn OperationContext object that represents the context for the current operation.
Returns
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
StreamThe stream providing the file content.
length
longThe number of bytes to write from the source stream at its current position.
accessCondition
AccessConditionAn AccessCondition object that represents the access conditions for the file. If
null
, no condition is used.options
FileRequestOptionsAn FileRequestOptions object that specifies additional options for the request.
operationContext
OperationContextAn OperationContext object that represents the context for the current operation.
progressHandler
IProgress<StorageProgress>A IProgress<T> object to handle StorageProgress messages.
cancellationToken
CancellationTokenA CancellationToken to observe while waiting for a task to complete.
Returns
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
StreamThe stream providing the file content.
length
longThe number of bytes to write from the source stream at its current position.
accessCondition
AccessConditionAn AccessCondition object that represents the access conditions for the file. If
null
, no condition is used.options
FileRequestOptionsAn FileRequestOptions object that specifies additional options for the request.
operationContext
OperationContextAn OperationContext object that represents the context for the current operation.
cancellationToken
CancellationTokenA CancellationToken to observe while waiting for a task to complete.
Returns
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
StreamThe stream providing the file content.
length
longThe number of bytes to write from the source stream at its current position.
cancellationToken
CancellationTokenA CancellationToken to observe while waiting for a task to complete.
Returns
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
StreamThe stream providing the file content.
cancellationToken
CancellationTokenA CancellationToken to observe while waiting for a task to complete.
Returns
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
stringThe text to upload.
encoding
EncodingAn object that indicates the text encoding to use. If null, UTF-8 will be used.
accessCondition
AccessConditionAn AccessCondition object that represents the access conditions for the file.
options
FileRequestOptionsA FileRequestOptions object that specifies additional options for the request.
operationContext
OperationContextAn 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
stringThe text to upload.
Returns
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
stringThe text to upload.
encoding
EncodingAn object that indicates the text encoding to use. If null, UTF-8 will be used.
accessCondition
AccessConditionAn AccessCondition object that represents the access conditions for the file.
options
FileRequestOptionsAn FileRequestOptions object that specifies additional options for the request.
operationContext
OperationContextAn OperationContext object that represents the context for the current operation.
Returns
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
stringThe text to upload.
encoding
EncodingAn object that indicates the text encoding to use. If null, UTF-8 will be used.
accessCondition
AccessConditionAn AccessCondition object that represents the access conditions for the file.
options
FileRequestOptionsAn FileRequestOptions object that specifies additional options for the request.
operationContext
OperationContextAn OperationContext object that represents the context for the current operation.
progressHandler
IProgress<StorageProgress>A IProgress<T> object to handle StorageProgress messages.
cancellationToken
CancellationTokenA CancellationToken to observe while waiting for a task to complete.
Returns
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
stringThe text to upload.
encoding
EncodingAn object that indicates the text encoding to use. If null, UTF-8 will be used.
accessCondition
AccessConditionAn AccessCondition object that represents the access conditions for the file.
options
FileRequestOptionsAn FileRequestOptions object that specifies additional options for the request.
operationContext
OperationContextAn OperationContext object that represents the context for the current operation.
cancellationToken
CancellationTokenA CancellationToken to observe while waiting for a task to complete.
Returns
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
stringThe text to upload.
cancellationToken
CancellationTokenA CancellationToken to observe while waiting for a task to complete.
Returns
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
StreamA stream providing the data.
startOffset
longThe offset at which to begin writing, in bytes.
contentMD5
stringAn optional hash value that will be used to set the ContentMD5 property on the file. May be
null
or an empty string.accessCondition
AccessConditionAn AccessCondition object that represents the access conditions for the file. If
null
, no condition is used.options
FileRequestOptionsAn FileRequestOptions object that specifies additional options for the request.
operationContext
OperationContextAn OperationContext object that represents the context for the current operation.
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
StreamA stream providing the data.
startOffset
longThe offset at which to begin writing, in bytes.
contentMD5
stringAn optional hash value that will be used to set the ContentMD5 property on the file. May be
null
or an empty string.
Returns
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
StreamA stream providing the data.
startOffset
longThe offset at which to begin writing, in bytes.
contentMD5
stringAn optional hash value that will be used to set the ContentMD5 property on the file. May be
null
or an empty string.accessCondition
AccessConditionAn AccessCondition object that represents the access conditions for the file. If
null
, no condition is used.options
FileRequestOptionsA FileRequestOptions object that specifies additional options for the request.
operationContext
OperationContextAn OperationContext object that represents the context for the current operation.
Returns
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
StreamA stream providing the data.
startOffset
longThe offset at which to begin writing, in bytes.
contentMD5
stringAn optional hash value that will be used to set the ContentMD5 property on the file. May be
null
or an empty string.accessCondition
AccessConditionAn AccessCondition object that represents the access conditions for the file. If
null
, no condition is used.options
FileRequestOptionsA FileRequestOptions object that specifies additional options for the request.
operationContext
OperationContextAn OperationContext object that represents the context for the current operation.
progressHandler
IProgress<StorageProgress>A IProgress<T> object to handle StorageProgress messages.
cancellationToken
CancellationTokenA CancellationToken to observe while waiting for a task to complete.
Returns
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
StreamA stream providing the data.
startOffset
longThe offset at which to begin writing, in bytes.
contentMD5
stringAn optional hash value that will be used to set the ContentMD5 property on the file. May be
null
or an empty string.accessCondition
AccessConditionAn AccessCondition object that represents the access conditions for the file. If
null
, no condition is used.options
FileRequestOptionsA FileRequestOptions object that specifies additional options for the request.
operationContext
OperationContextAn OperationContext object that represents the context for the current operation.
cancellationToken
CancellationTokenA CancellationToken to observe while waiting for a task to complete.
Returns
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
StreamA stream providing the data.
startOffset
longThe offset at which to begin writing, in bytes.
contentMD5
stringAn optional hash value that will be used to set the ContentMD5 property on the file. May be
null
or an empty string.cancellationToken
CancellationTokenA CancellationToken to observe while waiting for a task to complete.