AzureBlobsFileReference
Namespace: Proffer.Storage.Azure.Blobs.Internal
A reference of a stored file at a given path on Azure Blobs.
public class AzureBlobsFileReference : Proffer.Storage.IFileReference, Proffer.Storage.IPrivateFileReference
Inheritance Object → AzureBlobsFileReference
Implements IFileReference, IPrivateFileReference
Properties
Path
Gets the file path.
public string Path { get; }
Property Value
Properties
Gets the properties.
public IFileProperties Properties { get; }
Property Value
IFileProperties
PublicUrl
Gets the public URL.
public string PublicUrl { get; }
Property Value
Constructors
AzureBlobsFileReference(BlobClient, AzureBlobsFileProperties)
Initializes a new instance of the AzureBlobsFileReference class.
public AzureBlobsFileReference(BlobClient blobClient, AzureBlobsFileProperties properties)
Parameters
blobClient
BlobClient
The Azure Blobs client.
properties
AzureBlobsFileProperties
The properties, if fetched.
Methods
DeleteAsync()
Deletes the file.
public Task DeleteAsync()
Returns
A task that represents the asynchronous operation.
ReadAsync()
Reads the file content.
public ValueTask<Stream> ReadAsync()
Returns
ValueTask<Stream>
A containing the file content.
ReadInMemoryAsync()
Reads the file content in memory.
public ValueTask<MemoryStream> ReadInMemoryAsync()
Returns
ValueTask<MemoryStream>
A new containing the file content.
UpdateAsync(Stream)
Updates the file content with the given Stream.
public Task UpdateAsync(Stream stream)
Parameters
stream
Stream
The new file content.
Returns
A task that represents the asynchronous operation.
ReadToStreamAsync(Stream)
Reads the file content into the given stream.
public Task ReadToStreamAsync(Stream targetStream)
Parameters
targetStream
Stream
The target stream.
Returns
ReadAllTextAsync()
Reads the file content.
public ValueTask<string> ReadAllTextAsync()
Returns
ValueTask<String>
A containing the file content.
ReadAllBytesAsync()
Reads the file content.
public ValueTask<Byte[]> ReadAllBytesAsync()
Returns
ValueTask<Byte[]>
A containing the file content.
SavePropertiesAsync()
Saves the file properties.
public Task SavePropertiesAsync()
Returns
A task that represents the asynchronous operation.
GetSharedAccessSignature(ISharedAccessPolicy)
Gets a shared access signature.
public ValueTask<string> GetSharedAccessSignature(ISharedAccessPolicy policy)
Parameters
policy
ISharedAccessPolicy
The policy.
Returns
ValueTask<String>
A shared access signature to read file.
FetchProperties()
Fetches the file properties.
public Task FetchProperties()
Returns
Task
A task that represents the asynchronous operation.