StorageDisk class abstract
A simple contract for a file storage system.
This contract is a base for all file storage systems. It provides a simple and easy-to-use interface for saving and retrieving files from the disk or remote sources.
- Implementers
Constructors
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
-
copy(
String from, String to) → Future< void> - Copies the file from one path to another.
-
delete(
String path) → Future< void> - Deletes the file saved at the given path on the disk.
-
deleteDirectory(
String path) → Future< void> - Deletes a directory.
-
exists(
String path) → Future< bool> - Checks if the file exists at the given path.
-
get(
String path) → Future< List< int> > - Retrieves the bytes saved at the given path on the disk.
-
getStream(
String path) → Stream< List< int> > - Retrieves the file content as a stream.
-
lastModified(
String path) → Future< DateTime> - Returns the last modified time of the file.
-
listFiles(
String directoryPath) → Future< List< String> > - Lists files under the specified directory.
-
makeDirectory(
String path) → Future< void> - Creates a directory.
-
mimeType(
String path) → Future< String?> - Returns the MIME type of the file.
-
move(
String from, String to) → Future< void> - Moves the file from one path to another.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
put(
String path, List< int> bytes) → Future<void> - Saves the given bytes to the given path on the disk.
-
putStream(
String path, Stream< List< stream) → Future<int> >void> - Saves the given stream to the given path on the disk.
-
readString(
String path) → Future< String> - Reads a string from a file.
-
size(
String path) → Future< int> - Returns the size of the file in bytes.
-
temporaryUrl(
String path, DateTime expiration) → Future< String> - Returns a temporary URL to the file (e.g. signed URL).
-
toString(
) → String -
A string representation of this object.
inherited
-
url(
String path) → String - Returns the full URL or public path to the file.
-
writeString(
String path, String content) → Future< void> - Writes a string directly to a file.
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited