Class QAbstractStorage
Represents an abstract class to a resource or result storage class. One classe implement this interface: QBucket
Inherited Members
Namespace: QarnotSDK
Assembly: QarnotSDK.dll
Syntax
public abstract class QAbstractStorage
Properties
Connection
The inner Connection object.
Declaration
public abstract Connection Connection { get; }
Property Value
Type | Description |
---|---|
Connection |
CreationDate
The storage creation date
Declaration
public abstract DateTime CreationDate { get; }
Property Value
Type | Description |
---|---|
DateTime |
FileCount
Number of files in this storage. Use Update or UpdateAsync to refresh.
Declaration
public abstract int FileCount { get; }
Property Value
Type | Description |
---|---|
int |
Shortname
The storage shortname identifier. The shortname is provided by the user. It has to be unique. Note: For a bucket, shortname is the bucket name.
Declaration
public abstract string Shortname { get; protected set; }
Property Value
Type | Description |
---|---|
string |
UniqueId
A storage unique identifier. Note: For a bucket, the unique id is the bucket name. For a bucket, the unique id is the bucket Uuid.
Declaration
public abstract string UniqueId { get; }
Property Value
Type | Description |
---|---|
string |
UsedSpaceBytes
Size of this storage in bytes. Use Update or UpdateAsync to refresh.
Declaration
public abstract long UsedSpaceBytes { get; }
Property Value
Type | Description |
---|---|
long |
Methods
Create(CancellationToken)
Create the storage. Note: if the storage already exists, no exception is thrown.
Declaration
[Obsolete("Create is deprecated, please use CreateAsync instead.")]
public virtual void Create(CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
CancellationToken | cancellationToken | A token to cancel the request. |
CreateAsync(CancellationToken)
Create the storage. Note: if the storage already exists, no exception is thrown.
Declaration
public abstract Task CreateAsync(CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
CancellationToken | cancellationToken |
Returns
Type | Description |
---|---|
Task |
Delete(CancellationToken)
Delete the storage.
Declaration
[Obsolete("Delete is deprecated, please use DeleteAsync instead.")]
public virtual void Delete(CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
CancellationToken | cancellationToken | Optional token to cancel the request. |
DeleteAsync(CancellationToken)
Delete this storage.
Declaration
public abstract Task DeleteAsync(CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
CancellationToken | cancellationToken |
Returns
Type | Description |
---|---|
Task |
DeleteEntry(string, CancellationToken)
Delete a file or folder in this storage.
Declaration
[Obsolete("DeleteEntry is deprecated, please use DeleteEntryAsync instead.")]
public virtual void DeleteEntry(string remotePath, CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
string | remotePath | The entry to remove. |
CancellationToken | cancellationToken | Optional token to cancel the request. |
DeleteEntryAsync(string, CancellationToken)
Delete a file or folder in this storage.
Declaration
public abstract Task DeleteEntryAsync(string remotePath, CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
string | remotePath | The entry to remove. |
CancellationToken | cancellationToken | Optional token to cancel the request. |
Returns
Type | Description |
---|---|
Task |
DownloadFile(string, string, CancellationToken)
Download a file from this storage to a local file.
Declaration
[Obsolete("DownloadFile is deprecated, please use DownloadFileAsync instead.")]
public virtual void DownloadFile(string remoteFile, string localFile, CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
string | remoteFile | The source file name in this storage. |
string | localFile | The destination local file name. |
CancellationToken | cancellationToken | Optional token to cancel the request. |
DownloadFileAsync(string, string, CancellationToken)
Download a file from this storage to a local file.
Declaration
public virtual Task DownloadFileAsync(string remoteFile, string localFile, CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
string | remoteFile | The source file name in this storage. |
string | localFile | The destination local file name. |
CancellationToken | cancellationToken | Optional token to cancel the request. |
Returns
Type | Description |
---|---|
Task |
DownloadFolder(string, string, CancellationToken)
Download a folder in this storage to a local folder.
Declaration
[Obsolete("DownloadFolder is deprecated, please use DownloadFolderAsync instead.")]
public virtual void DownloadFolder(string remoteFolderPath, string localFolderPath, CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
string | remoteFolderPath | The source folder path in this storage. |
string | localFolderPath | The destination folder path. |
CancellationToken | cancellationToken | Optional token to cancel the request. |
DownloadFolderAsync(string, string, CancellationToken)
Download a folder in this storage to a local folder.
Declaration
public virtual Task DownloadFolderAsync(string remoteFolderPath, string localFolderPath, CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
string | remoteFolderPath | The source folder path in this storage. |
string | localFolderPath | The destination folder path. |
CancellationToken | cancellationToken | Optional token to cancel the request. |
Returns
Type | Description |
---|---|
Task |
DownloadStream(string, char, CancellationToken)
Get a stream on a file in this storage.
Declaration
[Obsolete("DownloadStream is deprecated, please use DownloadStreamAsync instead.")]
public virtual Stream DownloadStream(string remoteFile, char pathDirectorySeparator, CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
string | remoteFile | The source file name in this storage. |
char | pathDirectorySeparator | Platform separator directory for provided path. |
CancellationToken | cancellationToken | Optional token to cancel the request. |
Returns
Type | Description |
---|---|
Stream | A stream with the file's data. |
DownloadStream(string, CancellationToken)
Get a stream on a file in this storage.
Declaration
[Obsolete("DownloadStream is deprecated, please use DownloadStreamAsync instead.")]
public virtual Stream DownloadStream(string remoteFile, CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
string | remoteFile | The source file name in this storage. |
CancellationToken | cancellationToken | Optional token to cancel the request. |
Returns
Type | Description |
---|---|
Stream | A stream with the file's data. |
DownloadStreamAsync(string, char, CancellationToken)
Get a stream on a file in this storage.
Declaration
public abstract Task<Stream> DownloadStreamAsync(string remoteFile, char pathDirectorySeparator, CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
string | remoteFile | The source file name in this storage. |
char | pathDirectorySeparator | Platform separator directory for provided path. |
CancellationToken | cancellationToken | Optional token to cancel the request. |
Returns
Type | Description |
---|---|
Task<Stream> | A stream with the file's data. |
DownloadStreamAsync(string, CancellationToken)
Get a stream on a file in this storage.
Declaration
public abstract Task<Stream> DownloadStreamAsync(string remoteFile, CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
string | remoteFile | The source file name in this storage. |
CancellationToken | cancellationToken | Optional token to cancel the request. |
Returns
Type | Description |
---|---|
Task<Stream> | A stream with the file's data. |
DownloadString(string, Encoding, CancellationToken)
Get the text content of a file in this storage.
Declaration
[Obsolete("DownloadString is deprecated, please use DownloadStringAsync instead.")]
public virtual string DownloadString(string remoteFile, Encoding encoding = null, CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
string | remoteFile | The source file name in this storage. |
Encoding | encoding | The encoding to use to read the string. UTF8 by default. |
CancellationToken | cancellationToken | Optional token to cancel the request. |
Returns
Type | Description |
---|---|
string |
DownloadStringAsync(string, Encoding, CancellationToken)
Get the text content of a file in this storage.
Declaration
public virtual Task<string> DownloadStringAsync(string remoteFile, Encoding encoding = null, CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
string | remoteFile | The source file name in this storage. |
Encoding | encoding | The encoding to use to read the string. UTF8 by default. |
CancellationToken | cancellationToken | Optional token to cancel the request. |
Returns
Type | Description |
---|---|
Task<string> |
ListEntries(string, CancellationToken)
List the files and folders entries in the corresponding folder.
Declaration
[Obsolete("ListEntries is deprecated, please use ListEntriesAsync instead.")]
public virtual List<QAbstractStorageEntry> ListEntries(string remoteFolder, CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
string | remoteFolder | The folder to list. |
CancellationToken | cancellationToken | Optional token to cancel the request. |
Returns
Type | Description |
---|---|
List<QAbstractStorageEntry> | A list of QFile |
ListEntriesAsync(string, CancellationToken)
List the files and folders entries in the corresponding folder.
Declaration
public abstract Task<List<QAbstractStorageEntry>> ListEntriesAsync(string remoteFolder, CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
string | remoteFolder | The folder to list. |
CancellationToken | cancellationToken | Optional token to cancel the request. |
Returns
Type | Description |
---|---|
Task<List<QAbstractStorageEntry>> | A list of QFile |
ListFiles(string, CancellationToken)
List all the files and folders from the root of the bucket.
Declaration
[Obsolete("ListFiles is deprecated, please use ListFilesAsync instead.")]
public virtual List<QAbstractStorageEntry> ListFiles(string prefix, CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
string | prefix | Prefix for file search. |
CancellationToken | cancellationToken | Optional token to cancel the request. |
Returns
Type | Description |
---|---|
List<QAbstractStorageEntry> | A list of storage entries |
ListFiles(CancellationToken)
List all the files and folders from the root of the bucket.
Declaration
[Obsolete("ListFiles is deprecated, please use ListFilesAsync instead.")]
public virtual List<QAbstractStorageEntry> ListFiles(CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
CancellationToken | cancellationToken | Optional token to cancel the request. |
Returns
Type | Description |
---|---|
List<QAbstractStorageEntry> | A list of storage entries |
ListFilesAsync(string, CancellationToken)
List all the files and folders from the root of the bucket.
Declaration
public abstract Task<List<QAbstractStorageEntry>> ListFilesAsync(string prefix, CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
string | prefix | Prefix for file search. |
CancellationToken | cancellationToken | Optional token to cancel the request. |
Returns
Type | Description |
---|---|
Task<List<QAbstractStorageEntry>> | A list of storage entries |
ListFilesAsync(CancellationToken)
List all the files and folders from the root of the bucket.
Declaration
public abstract Task<List<QAbstractStorageEntry>> ListFilesAsync(CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
CancellationToken | cancellationToken | Optional token to cancel the request. |
Returns
Type | Description |
---|---|
Task<List<QAbstractStorageEntry>> | A list of QFile |
SyncLocalToRemote(string, bool, string)
Synchronize a local folder to a remote folder.
Declaration
[Obsolete("SyncLocalToRemote is deprecated, please use SyncLocalToRemoteAsync instead.")]
public virtual void SyncLocalToRemote(string localFolderPath, bool dontDelete = true, string remoteFolderRelativePath = "")
Parameters
Type | Name | Description |
---|---|---|
string | localFolderPath | The source local folder to upload. |
bool | dontDelete | If false, the files that have been deleted in the local folder will also be removed from this storage. To avoid mistakes, this parameter is set to true by default. |
string | remoteFolderRelativePath | Optional, allows to sync to a sub-folder of this storage. |
SyncLocalToRemote(string, CancellationToken, bool, string)
Synchronize a local folder to a remote folder.
Declaration
[Obsolete("SyncLocalToRemote is deprecated, please use SyncLocalToRemoteAsync instead.")]
public virtual void SyncLocalToRemote(string localFolderPath, CancellationToken cancellationToken, bool dontDelete = true, string remoteFolderRelativePath = "")
Parameters
Type | Name | Description |
---|---|---|
string | localFolderPath | The source local folder to upload. |
CancellationToken | cancellationToken | A token to cancel the request. |
bool | dontDelete | If false, the files that have been deleted in the local folder will also be removed from this storage. To avoid mistakes, this parameter is set to true by default. |
string | remoteFolderRelativePath | Optional, allows to sync to a sub-folder of this storage. |
SyncLocalToRemoteAsync(string, bool, string)
Synchronize a local folder to a remote folder.
Declaration
public virtual Task SyncLocalToRemoteAsync(string localFolderPath, bool dontDelete = true, string remoteFolderRelativePath = "")
Parameters
Type | Name | Description |
---|---|---|
string | localFolderPath | The source local folder to upload. |
bool | dontDelete | If false, the files that have been deleted in the local folder will also be removed from this storage. To avoid mistakes, this parameter is set to true by default. |
string | remoteFolderRelativePath | Optional, allows to sync to a sub-folder of this storage. |
Returns
Type | Description |
---|---|
Task |
SyncLocalToRemoteAsync(string, CancellationToken, bool, string)
Synchronize a local folder to a remote folder.
Declaration
public virtual Task SyncLocalToRemoteAsync(string localFolderPath, CancellationToken cancellationToken, bool dontDelete = true, string remoteFolderRelativePath = "")
Parameters
Type | Name | Description |
---|---|---|
string | localFolderPath | The source local folder to upload. |
CancellationToken | cancellationToken | A token to cancel the request. |
bool | dontDelete | If false, the files that have been deleted in the local folder will also be removed from this storage. To avoid mistakes, this parameter is set to true by default. |
string | remoteFolderRelativePath | Optional, allows to sync to a sub-folder of this storage. |
Returns
Type | Description |
---|---|
Task |
SyncRemoteToLocal(string, bool, string)
Synchronize a remote folder to a local folder.
Declaration
[Obsolete("SyncRemoteToLocal is deprecated, please use SyncRemoteToLocalAsync instead.")]
public virtual void SyncRemoteToLocal(string localFolderPath, bool dontDelete = true, string remoteFolderRelativePath = "")
Parameters
Type | Name | Description |
---|---|---|
string | localFolderPath | The local folder to overwrite. |
bool | dontDelete | If false, the files that have been deleted in this storage will also be removed in the local folder. To avoid mistakes, this parameter is set to true by default. |
string | remoteFolderRelativePath | Optional, allows to sync only a sub-folder of this storage. |
SyncRemoteToLocal(string, CancellationToken, bool, string)
Synchronize a remote folder to a local folder.
Declaration
[Obsolete("SyncRemoteToLocal is deprecated, please use SyncRemoteToLocalAsync instead.")]
public virtual void SyncRemoteToLocal(string localFolderPath, CancellationToken cancellationToken, bool dontDelete = true, string remoteFolderRelativePath = "")
Parameters
Type | Name | Description |
---|---|---|
string | localFolderPath | The local folder to overwrite. |
CancellationToken | cancellationToken | A token to cancel the request. |
bool | dontDelete | If false, the files that have been deleted in this storage will also be removed in the local folder. To avoid mistakes, this parameter is set to true by default. |
string | remoteFolderRelativePath | Optional, allows to sync only a sub-folder of this storage. |
SyncRemoteToLocalAsync(string, bool, string)
Synchronize a remote folder to a local folder.
Declaration
public virtual Task SyncRemoteToLocalAsync(string localFolderPath, bool dontDelete = true, string remoteFolderRelativePath = "")
Parameters
Type | Name | Description |
---|---|---|
string | localFolderPath | The local folder to overwrite. |
bool | dontDelete | If false, the files that have been deleted in this storage will also be removed in the local folder. To avoid mistakes, this parameter is set to true by default. |
string | remoteFolderRelativePath | Optional, allows to sync only a sub-folder of this storage. |
Returns
Type | Description |
---|---|
Task |
SyncRemoteToLocalAsync(string, CancellationToken, bool, string)
Synchronize a remote folder to a local folder.
Declaration
public virtual Task SyncRemoteToLocalAsync(string localFolderPath, CancellationToken cancellationToken, bool dontDelete = true, string remoteFolderRelativePath = "")
Parameters
Type | Name | Description |
---|---|---|
string | localFolderPath | The local folder to overwrite. |
CancellationToken | cancellationToken | A token to cancel the request. |
bool | dontDelete | If false, the files that have been deleted in this storage will also be removed in the local folder. To avoid mistakes, this parameter is set to true by default. |
string | remoteFolderRelativePath | Optional, allows to sync only a sub-folder of this storage. |
Returns
Type | Description |
---|---|
Task |
Update(CancellationToken)
Update this storage file count and storage usage.
Declaration
[Obsolete("Update is deprecated, please use UpdateAsync instead.")]
public virtual void Update(CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
CancellationToken | cancellationToken | Optional token to cancel the request. |
UpdateAsync(CancellationToken)
Update this storage file count and storage usage.
Declaration
public abstract Task UpdateAsync(CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
CancellationToken | cancellationToken | Optional token to cancel the request. |
Returns
Type | Description |
---|---|
Task |
UploadBytes(byte[], string, CancellationToken)
Write binary data to a file in this storage.
Declaration
[Obsolete("UploadBytes is deprecated, please use UploadBytesAsync instead.")]
public virtual void UploadBytes(byte[] data, string remoteFile, CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
byte[] | data | The binary buffer to write. |
string | remoteFile | The destination file name in this storage. |
CancellationToken | cancellationToken | Optional token to cancel the request. |
UploadBytesAsync(byte[], string, CancellationToken)
Write binary data to a file in this storage.
Declaration
public virtual Task UploadBytesAsync(byte[] data, string remoteFile, CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
byte[] | data | The binary buffer to write. |
string | remoteFile | The destination file name in this storage. |
CancellationToken | cancellationToken | Optional token to cancel the request. |
Returns
Type | Description |
---|---|
Task |
UploadFile(string, string, CancellationToken)
Upload a local file to a file in this storage.
Declaration
[Obsolete("UploadFile is deprecated, please use UploadFileAsync instead.")]
public virtual void UploadFile(string localFile, string remoteFile = null, CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
string | localFile | The source local file name. |
string | remoteFile | The destination file name in this storage. |
CancellationToken | cancellationToken | Optional token to cancel the request. |
UploadFileAsync(string, string, CancellationToken)
Upload a local file to a file in this storage.
Declaration
public virtual Task UploadFileAsync(string localFile, string remoteFile = null, CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
string | localFile | The source local file name. |
string | remoteFile | The destination file name in this storage. |
CancellationToken | cancellationToken | Optional token to cancel the request. |
Returns
Type | Description |
---|---|
Task |
UploadFolder(string, string, CancellationToken)
Upload a folder to a folder in this storage.
Declaration
[Obsolete("UploadFolder is deprecated, please use UploadFolderAsync instead.")]
public virtual void UploadFolder(string localFolderPath, string remoteFolderPath = null, CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
string | localFolderPath | The source folder path. |
string | remoteFolderPath | The destination folder path in this storage. |
CancellationToken | cancellationToken | Optional token to cancel the request. |
UploadFolderAsync(string, string, CancellationToken)
Upload a folder to a folder in this storage.
Declaration
public virtual Task UploadFolderAsync(string localFolderPath, string remoteFolderPath = null, CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
string | localFolderPath | The source folder path. |
string | remoteFolderPath | The destination folder path in this storage. |
CancellationToken | cancellationToken | Optional token to cancel the request. |
Returns
Type | Description |
---|---|
Task |
UploadStream(Stream, string, char, CancellationToken)
Write a stream to a file in this storage.
Declaration
[Obsolete("UploadStream is deprecated, please use UploadStreamAsync instead.")]
public virtual void UploadStream(Stream sourceStream, string remoteFile, char pathDirectorySeparator, CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
Stream | sourceStream | The source stream. |
string | remoteFile | The destination file name in this storage. |
char | pathDirectorySeparator | PathDirectorySeprator char that will change the remote file path to match the folder hierarchy. |
CancellationToken | cancellationToken | Optional token to cancel the request. |
UploadStream(Stream, string, CancellationToken)
Write a stream to a file in this storage.
Declaration
[Obsolete("UploadStream is deprecated, please use UploadStreamAsync instead.")]
public virtual void UploadStream(Stream sourceStream, string remoteFile, CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
Stream | sourceStream | The source stream. |
string | remoteFile | The destination file name in this storage. |
CancellationToken | cancellationToken | Optional token to cancel the request. |
UploadStreamAsync(Stream, string, char, CancellationToken)
Write a stream to a file in this storage.
Declaration
public abstract Task UploadStreamAsync(Stream sourceStream, string remoteFile, char pathDirectorySeparator, CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
Stream | sourceStream | The source stream. |
string | remoteFile | The destination file name in this storage. |
char | pathDirectorySeparator | Platform separator directory for provided path. |
CancellationToken | cancellationToken | Optional token to cancel the request. |
Returns
Type | Description |
---|---|
Task |
UploadStreamAsync(Stream, string, CancellationToken)
Write a stream to a file in this storage.
Declaration
public abstract Task UploadStreamAsync(Stream sourceStream, string remoteFile, CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
Stream | sourceStream | The source stream. |
string | remoteFile | The destination file name in this storage. |
CancellationToken | cancellationToken | Optional token to cancel the request. |
Returns
Type | Description |
---|---|
Task |
UploadString(string, string, Encoding, CancellationToken)
Write a string to a file in this storage.
Declaration
[Obsolete("UploadString is deprecated, please use UploadStringAsync instead.")]
public virtual void UploadString(string content, string remoteFile, Encoding encoding = null, CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
string | content | The content to write. |
string | remoteFile | The destination file name in this storage. |
Encoding | encoding | The encoding to use to write the string. UTF8 by default. |
CancellationToken | cancellationToken | Optional token to cancel the request. |
UploadStringAsync(string, string, Encoding, CancellationToken)
Write a string to a file in this storage.
Declaration
public virtual Task UploadStringAsync(string content, string remoteFile, Encoding encoding = null, CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
string | content | The content to write. |
string | remoteFile | The destination file name in this storage. |
Encoding | encoding | The encoding to use to write the string. UTF8 by default. |
CancellationToken | cancellationToken | Optional token to cancel the request. |
Returns
Type | Description |
---|---|
Task |