FileStorage class abstract
Interface for managing file and folder storage operations.
Constructors
Properties
Methods
-
createFile(
{required String fileName, required Uint8List data, String? parentFolderId, VaultCancelToken? cancelToken, VaultProgressCallback? onSendProgress}) → Future< void> - Allows adding a new file Throws if there is another file with the same name in the folder Throws for timeouts Throws for network connectivity Throws if exceeds space usage
-
createFolder(
{required String folderName, required String parentFolderId, VaultCancelToken? cancelToken}) → Future< Folder> - Allows creating a folder Throws if parentFolderId does not exist Throws if parentFolderId is not a folder Throws if folderName is already in use within the same parent folder Throws for network connectivity
-
deleteFile(
{required String fileId, VaultCancelToken? cancelToken}) → Future< void> - Allows deleting a file Throws if the file does not exist Throws if the file is not a file Throws for network connectivity
-
deleteFolder(
{required String folderId, VaultCancelToken? cancelToken}) → Future< void> - Allows deleting a folder Throws if folder does not exists Throws if id does not match a folder Throws if folder is not empty Throws for network connectivity
-
getFile(
{required String fileId, VaultCancelToken? cancelToken}) → Future< File> -
Allows retrieving a single file
Note: this is a
File
and not the file content which should usegetFileContent
instead. Question: Should the file also have size in bytes among its properties? This would be useful when deciding which file to delete especially when exceeding space usage. Throws if the file does not exist Throws if the file is not a file Throws for network connectivity -
getFileContent(
{required String fileId, VaultCancelToken? cancelToken, VaultProgressCallback? onReceiveProgress}) → Future< Uint8List> - Allows retrieving file content Throws if the file does not exist Throws if the fileId is not related to a file Throws for network connectivity
-
getFolder(
{String? folderId, int? limit, String? exclusiveStartItemId, VaultCancelToken? cancelToken}) → Future< PaginatedList< Item> > - Allows retrieving items within a folder with pagination support Returns a PaginatedList containing the items and pagination information Throws if the folder does not exist Throws if the folderId does not match a folder Throws for network connectivity
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
renameFile(
{required String fileId, required String newName, VaultCancelToken? cancelToken}) → Future< void> - Allows renaming a file Throws if there is another file with same name Throws if the nodeId does not match a file, i.e. is a folder. Throws for network connectivity
-
renameFolder(
{required String folderId, required String newName, VaultCancelToken? cancelToken}) → Future< void> - Allows renaming a folder Throws if folder does not exists Throws if id does not match a folder Throws if newName is already in use within the same parent folder Throws for network connectivity
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited