FileSystemFileReference
Namespace: Proffer.Storage.FileSystem.Internal
A reference of a stored file at a given path on a File System.
public class FileSystemFileReference : Proffer.Storage.IFileReference, Proffer.Storage.IPrivateFileReference
Inheritance Object → FileSystemFileReference
Implements IFileReference, IPrivateFileReference
Properties
FileSystemPath
Gets the file system path.
public string FileSystemPath { get; }
Property Value
Path
Gets the file path.
public string Path { get; }
Property Value
PublicUrl
Gets the public URL.
public string PublicUrl { get; }
Property Value
Properties
Gets the properties.
public IFileProperties Properties { get; }
Property Value
IFileProperties
Constructors
FileSystemFileReference(String, String, FileSystemStore, Boolean, FileExtendedProperties, IPublicUrlProvider, IExtendedPropertiesProvider)
Initializes a new instance of the FileSystemFileReference class.
public FileSystemFileReference(string filePath, string path, FileSystemStore store, bool withMetadata, FileExtendedProperties extendedProperties, IPublicUrlProvider publicUrlProvider, IExtendedPropertiesProvider extendedPropertiesProvider)
Parameters
filePath
String
The file system path.
path
String
The path.
store
FileSystemStore
The store.
withMetadata
Boolean
If set to true, the metadata for the file have been fetched.
extendedProperties
FileExtendedProperties
The extended properties.
publicUrlProvider
IPublicUrlProvider
The public URL provider.
extendedPropertiesProvider
IExtendedPropertiesProvider
The extended properties provider.
Methods
DeleteAsync()
Deletes the file.
public Task DeleteAsync()
Returns
A task that represents the asynchronous operation.
ReadAllBytesAsync()
Reads the file content.
public ValueTask<Byte[]> ReadAllBytesAsync()
Returns
ValueTask<Byte[]>
A containing the file content.
ReadAllTextAsync()
Reads the file content.
public ValueTask<string> ReadAllTextAsync()
Returns
ValueTask<String>
A containing the file content.
ReadAsync()
Reads the file content.
public ValueTask<Stream> ReadAsync()
Returns
ValueTask<Stream>
A containing the file content.
ReadToStreamAsync(Stream)
Reads the file content into the given stream.
public Task ReadToStreamAsync(Stream targetStream)
Parameters
targetStream
Stream
The target stream.
Returns
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.
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.