Microsoft.Azure.Storage.File.CloudFile
Represents a Microsoft Azure File.
Gets the state of the most recent or pending copy operation.
The file permission to set on the next File Create or Set Properties call.
This field will be null after File.Create, File.SetProperties, File.GetProperties, and File.Get calls.
Gets the user-defined metadata for the file.
Gets the file's name.
Gets the CloudFileDirectory object representing the
parent directory for the file.
Gets the file's system properties.
Gets the CloudFileClient object that represents the File service.
Gets a CloudFileShare object representing the file's share.
Gets the file's URI for both the primary and secondary locations, including query string information if the file's share is a snapshot.
Gets the absolute URI to the file, including query string information if the file's share is a snapshot.
Gets the absolute URI to the file.
Gets or sets the minimum number of bytes to buffer when reading from a file stream.
Gets or sets the number of bytes to buffer when writing to a file stream.
Gets the file's URI.
Initializes a new instance of the CloudFile class using an absolute URI to the file.
Initializes a new instance of the CloudFile class using an absolute URI to the file.
Initializes a new instance of the CloudFile class using an absolute URI to the file.
Aborts an ongoing copy operation.
public virtual Task AbortCopyAsync(string copyId, AccessCondition accessCondition, FileRequestOptions options, OperationContext operationContext)
Aborts an ongoing copy operation.
public virtual Task AbortCopyAsync(string copyId, AccessCondition accessCondition, FileRequestOptions options, OperationContext operationContext, CancellationToken cancellationToken)
Aborts an ongoing copy operation.
Clears ranges from a file.
public virtual Task ClearRangeAsync(long startOffset, long length, AccessCondition accessCondition, FileRequestOptions options, OperationContext operationContext)
Clears ranges from a file.
public virtual Task ClearRangeAsync(long startOffset, long length, AccessCondition accessCondition, FileRequestOptions options, OperationContext operationContext, CancellationToken cancellationToken)
Clears ranges from a file.
public virtual Task<CloseFileHandleResultSegment> CloseAllHandlesSegmentedAsync(FileContinuationToken token = null, AccessCondition accessCondition = null, FileRequestOptions options = null, OperationContext operationContext = null, CancellationToken? cancellationToken = default)
Returns a task that performs an asynchronous operation to close all SMB handles on this file.
public virtual Task<CloseFileHandleResultSegment> CloseHandleSegmentedAsync(string handleId, FileContinuationToken token = null, AccessCondition accessCondition = null, FileRequestOptions options = null, OperationContext operationContext = null, CancellationToken? cancellationToken = default)
Returns a task that performs an asynchronous operation to close the specified SMB handle on this file.
Creates a file. If the file already exists, it will be overwritten.
public virtual Task CreateAsync(long size, AccessCondition accessCondition, FileRequestOptions options, OperationContext operationContext)
Creates a file. If the file already exists, it will be overwritten.
public virtual Task CreateAsync(long size, AccessCondition accessCondition, FileRequestOptions options, OperationContext operationContext, CancellationToken cancellationToken)
Creates a file. If the file already exists, it will be overwritten.
Deletes the file.
public virtual Task DeleteAsync(AccessCondition accessCondition, FileRequestOptions options, OperationContext operationContext)
Deletes the file.
public virtual Task DeleteAsync(AccessCondition accessCondition, FileRequestOptions options, OperationContext operationContext, CancellationToken cancellationToken)
Deletes the file.
Deletes the file if it already exists.
public virtual Task<bool> DeleteIfExistsAsync(AccessCondition accessCondition, FileRequestOptions options, OperationContext operationContext)
Deletes the file if it already exists.
public virtual Task<bool> DeleteIfExistsAsync(AccessCondition accessCondition, FileRequestOptions options, OperationContext operationContext, CancellationToken cancellationToken)
Deletes the file if it already exists.
public virtual Task<int> DownloadRangeToByteArrayAsync(byte[] target, int index, long? fileOffset, long? length)
Downloads the contents of a file to a byte array.
public virtual Task<int> DownloadRangeToByteArrayAsync(byte[] target, int index, long? fileOffset, long? length, AccessCondition accessCondition, FileRequestOptions options, OperationContext operationContext)
Downloads the contents of a file to a byte array.
public virtual Task<int> DownloadRangeToByteArrayAsync(byte[] target, int index, long? fileOffset, long? length, AccessCondition accessCondition, FileRequestOptions options, OperationContext operationContext, CancellationToken cancellationToken)
Downloads the contents of a file to a byte array.
public virtual Task<int> DownloadRangeToByteArrayAsync(byte[] target, int index, long? fileOffset, long? length, AccessCondition accessCondition, FileRequestOptions options, OperationContext operationContext, IProgress<StorageProgress> progressHandler, CancellationToken cancellationToken)
Downloads the contents of a file to a byte array.
Downloads the contents of a file to a stream.
public virtual Task DownloadRangeToStreamAsync(Stream target, long? offset, long? length, AccessCondition accessCondition, FileRequestOptions options, OperationContext operationContext)
Downloads the contents of a file to a stream.
public virtual Task DownloadRangeToStreamAsync(Stream target, long? offset, long? length, AccessCondition accessCondition, FileRequestOptions options, OperationContext operationContext, CancellationToken cancellationToken)
Downloads the contents of a file to a stream.
public virtual Task DownloadRangeToStreamAsync(Stream target, long? offset, long? length, AccessCondition accessCondition, FileRequestOptions options, OperationContext operationContext, IProgress<StorageProgress> progressHandler, CancellationToken cancellationToken)
Downloads the contents of a file to a stream.
Downloads the file's contents as a string.
public virtual Task<string> DownloadTextAsync(AccessCondition accessCondition, FileRequestOptions options, OperationContext operationContext)
Downloads the file's contents as a string.
public virtual Task<string> DownloadTextAsync(AccessCondition accessCondition, FileRequestOptions options, OperationContext operationContext, CancellationToken cancellationToken)
Downloads the file's contents as a string.
public virtual Task<string> DownloadTextAsync(AccessCondition accessCondition, FileRequestOptions options, OperationContext operationContext, IProgress<StorageProgress> progressHandler, CancellationToken cancellationToken)
Downloads the file's contents as a string.
Downloads the contents of a file to a byte array.
public virtual Task<int> DownloadToByteArrayAsync(byte[] target, int index, AccessCondition accessCondition, FileRequestOptions options, OperationContext operationContext)
Downloads the contents of a file to a byte array.
public virtual Task<int> DownloadToByteArrayAsync(byte[] target, int index, AccessCondition accessCondition, FileRequestOptions options, OperationContext operationContext, IProgress<StorageProgress> progressHandler, CancellationToken cancellationToken)
Downloads the contents of a file to a byte array.
public virtual Task<int> DownloadToByteArrayAsync(byte[] target, int index, AccessCondition accessCondition, FileRequestOptions options, OperationContext operationContext, CancellationToken cancellationToken)
Downloads the contents of a file to a byte array.
public virtual Task DownloadToFileAsync(string path, FileMode mode, AccessCondition accessCondition, FileRequestOptions options, OperationContext operationContext)
public virtual Task DownloadToFileAsync(string path, FileMode mode, AccessCondition accessCondition, FileRequestOptions options, OperationContext operationContext, CancellationToken cancellationToken)
Downloads the contents of a file to a file.
public virtual Task DownloadToFileAsync(string path, FileMode mode, AccessCondition accessCondition, FileRequestOptions options, OperationContext operationContext, IProgress<StorageProgress> progressHandler, CancellationToken cancellationToken)
Downloads the contents of a file to a file.
Downloads the contents of a file to a stream.
public virtual Task DownloadToStreamAsync(Stream target, AccessCondition accessCondition, FileRequestOptions options, OperationContext operationContext)
Downloads the contents of a file to a stream.
public virtual Task DownloadToStreamAsync(Stream target, AccessCondition accessCondition, FileRequestOptions options, OperationContext operationContext, IProgress<StorageProgress> progressHandler, CancellationToken cancellationToken)
Downloads the contents of a file to a stream.
public virtual Task DownloadToStreamAsync(Stream target, AccessCondition accessCondition, FileRequestOptions options, OperationContext operationContext, CancellationToken cancellationToken)
Downloads the contents of a file to a stream.
Checks existence of the file.
public virtual Task<bool> ExistsAsync(FileRequestOptions options, OperationContext operationContext)
Checks existence of the file.
public virtual Task<bool> ExistsAsync(FileRequestOptions options, OperationContext operationContext, CancellationToken cancellationToken)
Checks existence of the file.
Populates a file's properties and metadata.
public virtual Task FetchAttributesAsync(AccessCondition accessCondition, FileRequestOptions options, OperationContext operationContext)
Populates a file's properties and metadata.
public virtual Task FetchAttributesAsync(AccessCondition accessCondition, FileRequestOptions options, OperationContext operationContext, CancellationToken cancellationToken)
Populates a file's properties and metadata.
Returns a shared access signature for the file.
Returns a shared access signature for the file.
public string GetSharedAccessSignature(SharedAccessFilePolicy policy, SharedAccessFileHeaders headers)
Returns a shared access signature for the file.
public string GetSharedAccessSignature(SharedAccessFilePolicy policy, SharedAccessFileHeaders headers, string groupPolicyIdentifier)
Returns a shared access signature for the file.
public string GetSharedAccessSignature(SharedAccessFilePolicy policy, SharedAccessFileHeaders headers, string groupPolicyIdentifier, SharedAccessProtocol? protocols, IPAddressOrRange ipAddressOrRange)
Returns a shared access signature for the file.
public virtual Task<FileHandleResultSegment> ListHandlesSegmentedAsync(FileContinuationToken token = null, int? maxResults = default, AccessCondition accessCondition = null, FileRequestOptions options = null, OperationContext operationContext = null, CancellationToken? cancellationToken = default)
Returns a task that performs an asynchronous operation to get the SMB handles open on this file.
public virtual Task<IEnumerable<FileRange>> ListRangesAsync(long? offset, long? length, AccessCondition accessCondition, FileRequestOptions options, OperationContext operationContext)
Gets a collection of valid ranges and their starting and ending bytes.
public virtual Task<IEnumerable<FileRange>> ListRangesAsync(long? offset, long? length, AccessCondition accessCondition, FileRequestOptions options, OperationContext operationContext, CancellationToken cancellationToken)
Gets a collection of valid ranges and their starting and ending bytes.
Opens a stream for reading from the file.
public virtual Task<Stream> OpenReadAsync(AccessCondition accessCondition, FileRequestOptions options, OperationContext operationContext)
Opens a stream for reading from the file.
public virtual Task<Stream> OpenReadAsync(AccessCondition accessCondition, FileRequestOptions options, OperationContext operationContext, CancellationToken cancellationToken)
Opens a stream for reading from the file.
Opens a stream for writing to the file. If the file already exists, then existing data in the file may be overwritten.
public virtual Task<CloudFileStream> OpenWriteAsync(long? size, AccessCondition accessCondition, FileRequestOptions options, OperationContext operationContext)
Opens a stream for writing to the file. If the file already exists, then existing data in the file may be overwritten.
public virtual Task<CloudFileStream> OpenWriteAsync(long? size, AccessCondition accessCondition, FileRequestOptions options, OperationContext operationContext, CancellationToken cancellationToken)
Opens a stream for writing to the file.
Resizes a file.
public virtual Task ResizeAsync(long size, AccessCondition accessCondition, FileRequestOptions options, OperationContext operationContext)
Resizes a file.
public virtual Task ResizeAsync(long size, AccessCondition accessCondition, FileRequestOptions options, OperationContext operationContext, CancellationToken cancellationToken)
Resizes a file.
Updates the file's metadata.
public virtual Task SetMetadataAsync(AccessCondition accessCondition, FileRequestOptions options, OperationContext operationContext)
Updates the file's metadata.
public virtual Task SetMetadataAsync(AccessCondition accessCondition, FileRequestOptions options, OperationContext operationContext, CancellationToken cancellationToken)
Updates the file's metadata.
Updates the file's properties.
public virtual Task SetPropertiesAsync(AccessCondition accessCondition, FileRequestOptions options, OperationContext operationContext)
Updates the file's properties.
public virtual Task SetPropertiesAsync(AccessCondition accessCondition, FileRequestOptions options, OperationContext operationContext, CancellationToken cancellationToken)
Updates the file's properties.
Begins an operation to start copying an existing blob or Azure file's contents, properties, and metadata to a new Azure file.
Begins an operation to start copying an existing Azure file's contents, properties, and metadata to a new Azure file.
public virtual Task<string> StartCopyAsync(Uri source, AccessCondition sourceAccessCondition, AccessCondition destAccessCondition, FileRequestOptions options, OperationContext operationContext)
Begins an operation to start copying a blob or file's contents, properties, and metadata to a new Azure file.
public virtual Task<string> StartCopyAsync(Uri source, AccessCondition sourceAccessCondition, AccessCondition destAccessCondition, FileRequestOptions options, OperationContext operationContext, CancellationToken cancellationToken)
Begins an operation to start copying a blob or file's contents, properties, and metadata to a new Azure file.
Uploads the contents of a byte array to a file. If the file already exists on the service, it will be overwritten.
public virtual Task UploadFromByteArrayAsync(byte[] buffer, int index, int count, AccessCondition accessCondition, FileRequestOptions options, OperationContext operationContext)
Uploads the contents of a byte array to a file. If the file already exists on the service, it will be overwritten.
public virtual Task UploadFromByteArrayAsync(byte[] buffer, int index, int count, AccessCondition accessCondition, FileRequestOptions options, OperationContext operationContext, CancellationToken cancellationToken)
Uploads the contents of a byte array to a file.
public virtual Task UploadFromByteArrayAsync(byte[] buffer, int index, int count, AccessCondition accessCondition, FileRequestOptions options, OperationContext operationContext, IProgress<StorageProgress> progressHandler, CancellationToken cancellationToken)
Uploads the contents of a byte array to a file.
public virtual Task UploadFromFileAsync(string path, AccessCondition accessCondition, FileRequestOptions options, OperationContext operationContext)
public virtual Task UploadFromFileAsync(string path, AccessCondition accessCondition, FileRequestOptions options, OperationContext operationContext, CancellationToken cancellationToken)
Uploads a file to the Azure File Service. If the file already exists on the service, it will be overwritten.
public virtual Task UploadFromFileAsync(string path, AccessCondition accessCondition, FileRequestOptions options, OperationContext operationContext, IProgress<StorageProgress> progressHandler, CancellationToken cancellationToken)
Uploads a file to the Azure File Service. If the file already exists on the service, it will be overwritten.
Uploads a stream to a file. If the file already exists on the service, it will be overwritten.
Uploads a stream to a file. If the file already exists on the service, it will be overwritten.
public virtual Task UploadFromStreamAsync(Stream source, AccessCondition accessCondition, FileRequestOptions options, OperationContext operationContext)
Uploads a stream to a file. If the file already exists on the service, it will be overwritten.
public virtual Task UploadFromStreamAsync(Stream source, long length, AccessCondition accessCondition, FileRequestOptions options, OperationContext operationContext)
Uploads a stream to a file. If the file already exists on the service, it will be overwritten.
public virtual Task UploadFromStreamAsync(Stream source, AccessCondition accessCondition, FileRequestOptions options, OperationContext operationContext, IProgress<StorageProgress> progressHandler, CancellationToken cancellationToken)
Uploads a stream to a file.
public virtual Task UploadFromStreamAsync(Stream source, AccessCondition accessCondition, FileRequestOptions options, OperationContext operationContext, CancellationToken cancellationToken)
Uploads a stream to a file.
public virtual Task UploadFromStreamAsync(Stream source, long length, AccessCondition accessCondition, FileRequestOptions options, OperationContext operationContext, IProgress<StorageProgress> progressHandler, CancellationToken cancellationToken)
Uploads a stream to a file.
public virtual Task UploadFromStreamAsync(Stream source, long length, AccessCondition accessCondition, FileRequestOptions options, OperationContext operationContext, CancellationToken cancellationToken)
Uploads a stream to a file.
Uploads a string of text to a file. If the file already exists on the service, it will be overwritten.
public virtual Task UploadTextAsync(string content, AccessCondition accessCondition, FileRequestOptions options, OperationContext operationContext)
Uploads a string of text to a file. If the file already exists on the service, it will be overwritten.
public virtual Task UploadTextAsync(string content, AccessCondition accessCondition, FileRequestOptions options, OperationContext operationContext, CancellationToken cancellationToken)
Uploads a string of text to a file. If the file already exists on the service, it will be overwritten.
public virtual Task UploadTextAsync(string content, AccessCondition accessCondition, FileRequestOptions options, OperationContext operationContext, IProgress<StorageProgress> progressHandler, CancellationToken cancellationToken)
Uploads a string of text to a file. If the file already exists on the service, it will be overwritten.
public virtual Task WriteRangeAsync(Uri sourceUri, long sourceOffset, long count, long destOffset, Checksum sourceContentChecksum = null, AccessCondition sourceAccessCondition = null, FileRequestOptions options = null, OperationContext operationContext = null, CancellationToken? cancellationToken = default)
Writes range from a source file to this file.
Writes range to a file.
public virtual Task WriteRangeAsync(Stream rangeData, long startOffset, string contentMD5, AccessCondition accessCondition, FileRequestOptions options, OperationContext operationContext)
Writes range to a file.
public virtual Task WriteRangeAsync(Stream rangeData, long startOffset, string contentMD5, AccessCondition accessCondition, FileRequestOptions options, OperationContext operationContext, CancellationToken cancellationToken)
Writes range to a file.
public virtual Task WriteRangeAsync(Stream rangeData, long startOffset, string contentMD5, AccessCondition accessCondition, FileRequestOptions options, OperationContext operationContext, IProgress<StorageProgress> progressHandler, CancellationToken cancellationToken)
Writes range to a file.