IOLocalStorage class final
Implements LocalStorage for device filesystem using Dart IO.
Handles file and directory operations for attachments. The database only stores relative paths for attachments that this implementation resolves against the root path provided as a constructor argument. For that reason, it's important that the root directory stays consistent, as data may be lost otherwise.
- Implemented types
- Annotations
-
- @experimental
Constructors
- IOLocalStorage.new(Directory _root)
-
const
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
clear(
) → Future< void> -
Clears all data from the storage.
override
-
deleteFile(
String filePath) → Future< void> -
Deletes a file at the specified path
override
-
fileExists(
String filePath) → Future< bool> -
Checks if a file exists at the specified path
override
-
initialize(
) → Future< void> -
Creates a directory and all necessary parent directories dynamically if they do not exist.
override
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
readFile(
String filePath, {String? mediaType}) → Stream< Uint8List> -
Retrieves binary data stream from storage at the specified file path
override
-
saveFile(
String filePath, Stream< List< data) → Future<int> >int> -
Saves binary data stream to storage at the specified file path
override
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited