Interface IFileStorageStore
Represents a file storage store interface that defines operations related to file storage stores.
Namespace: DataWeb.Storage
Assembly: DataWeb.Core.dll
Syntax
public interface IFileStorageStore
Properties
Name
Gets the name of the file storage store.
Declaration
string Name { get; }
Property Value
Type | Description |
---|---|
string |
Methods
CloneFileAsync(string, string, string, string, CancellationToken)
Clones a file from a source location to a target location within the storage.
Declaration
Task<StorageResult> CloneFileAsync(string sourceStorageFileName, string sourceStorageContainer, string targetStorageFileName, string targetStorageContainer, CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
string | sourceStorageFileName | The name of the file to clone. |
string | sourceStorageContainer | The name of the container where the file to clone is stored. |
string | targetStorageFileName | The name to give the file at the target location. |
string | targetStorageContainer | The name of the container to clone the file to. |
CancellationToken | cancellationToken |
Returns
Type | Description |
---|---|
Task<StorageResult> | A Task<TResult> that represents the asynchronous operation. The task result contains the result of the operation. |
DeleteFileAsync(string, string, CancellationToken)
Deletes a file from the storage.
Declaration
Task<StorageResult> DeleteFileAsync(string storageFileName, string storageContainer, CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
string | storageFileName | The name of the file to delete. |
string | storageContainer | The name of the container where the file to delete is stored. |
CancellationToken | cancellationToken |
Returns
Type | Description |
---|---|
Task<StorageResult> | A Task<TResult> that represents the asynchronous operation. The task result contains the result of the operation. |
DownloadFileStreamAsync(string, string, string, CancellationToken)
Downloads a file stream.
Declaration
Task<Stream> DownloadFileStreamAsync(string storagefileName, string storageContainer, string fileDomain = null, CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
string | storagefileName | The name of the file. |
string | storageContainer | The container where the file is stored. |
string | fileDomain | The domain where the file is stored. |
CancellationToken | cancellationToken |
Returns
Type | Description |
---|---|
Task<Stream> | The file stream. |
FileExistsAsync(string, string, CancellationToken)
Checks if a file exists.
Declaration
Task<bool> FileExistsAsync(string storageFileName, string storageContainer, CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
string | storageFileName | The name of the file. |
string | storageContainer | The container where the file is stored. |
CancellationToken | cancellationToken |
Returns
Type | Description |
---|---|
Task<bool> | True if the file exists; otherwise, false. |
GetFilePropertiesAsync(string, string, CancellationToken)
Gets the properties of a file.
Declaration
Task<StorageFileProperties> GetFilePropertiesAsync(string storageFileName, string storageContainer, CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
string | storageFileName | The name of the file. |
string | storageContainer | The container where the file is stored. |
CancellationToken | cancellationToken |
Returns
Type | Description |
---|---|
Task<StorageFileProperties> | The properties of the file. |
GetFileStreamAsync(string, string, CancellationToken)
Gets a stream of a file.
Declaration
Task<Stream> GetFileStreamAsync(string storageFileName, string storageContainer, CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
string | storageFileName | The name of the file. |
string | storageContainer | The container where the file is stored. |
CancellationToken | cancellationToken |
Returns
Type | Description |
---|---|
Task<Stream> | A stream of the file. |
GetNewStorageFileName(string)
Gets a new storage file name.
Declaration
string GetNewStorageFileName(string fileName)
Parameters
Type | Name | Description |
---|---|---|
string | fileName | The original file name. |
Returns
Type | Description |
---|---|
string | A new storage file name. |
GetStorageActualSizeAsync(CancellationToken)
Gets the actual size of the storage, in bytes.
Declaration
Task<long> GetStorageActualSizeAsync(CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
CancellationToken | cancellationToken |
Returns
Type | Description |
---|---|
Task<long> | A Task<TResult> that represents the asynchronous operation. The task result contains the actual size of the storage in bytes. |
GetStorageMaxSizeAsync(CancellationToken)
Gets the maximum allowed size for the storage.
Declaration
Task<long> GetStorageMaxSizeAsync(CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
CancellationToken | cancellationToken |
Returns
Type | Description |
---|---|
Task<long> | A Task<TResult> that represents the asynchronous operation. The task result contains the maximum allowed size for the storage in bytes. |
MoveFileAsync(string, string, string, string, CancellationToken)
Moves a file from a source location to a target location within the storage.
Declaration
Task<StorageResult> MoveFileAsync(string sourceStorageFileName, string sourceStorageContainer, string targetStorageFileName, string targetStorageContainer, CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
string | sourceStorageFileName | The name of the file to move. |
string | sourceStorageContainer | The name of the container where the file to move is stored. |
string | targetStorageFileName | The name to give the file at the target location. |
string | targetStorageContainer | The name of the container to move the file to. |
CancellationToken | cancellationToken |
Returns
Type | Description |
---|---|
Task<StorageResult> | A Task<TResult> that represents the asynchronous operation. The task result contains the result of the operation. |
UploadChunkStreamAsync(Stream, int, int, int, long, string, string, CancellationToken)
Uploads a chunk of a file.
Declaration
Task<StorageResult> UploadChunkStreamAsync(Stream stream, int chunkNumber, int chunkSize, int chunkCount, long storageFileSize, string storageFileName, string storageContainer, CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
Stream | stream | The file stream. |
int | chunkNumber | The number of the chunk. |
int | chunkSize | The size of the chunk. |
int | chunkCount | The number of chunks. |
long | storageFileSize | The size of the file. |
string | storageFileName | The name of the file. |
string | storageContainer | The container where the file will be stored. |
CancellationToken | cancellationToken |
Returns
Type | Description |
---|---|
Task<StorageResult> | The result of the upload. |
UploadFileStreamAsync(Stream, string, string, CancellationToken)
Uploads a file stream.
Declaration
Task<StorageResult> UploadFileStreamAsync(Stream stream, string storageFileName, string storageContainer, CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
Stream | stream | The file stream. |
string | storageFileName | The name of the file. |
string | storageContainer | The container where the file will be stored. |
CancellationToken | cancellationToken |
Returns
Type | Description |
---|---|
Task<StorageResult> | The result of the upload. |