Disk class abstract interface

A filesystem abstraction (Laravel Filesystem; BLUEPRINT_V2 §7.10.1). Paths are relative, /-separated and never escape the disk root.

Implementers
Available extensions

Properties

hashCode → int
The hash code for this object.
no setterinherited
name → String
The disk's name.
no setter
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited

Methods

allFiles([String directory = '']) → Future<List<String>>
Every file under directory, recursively.
append(String path, String contents) → Future<void>
Appends a line (adds a newline when the file is not empty).
copy(String from, String to) → Future<void>
Copies from to to.
delete(Object paths) → Future<bool>
Deletes files; returns true when every one existed.
deleteDirectory(String path) → Future<bool>
Deletes the directory path and its contents.
directories([String directory = '', bool recursive = false]) → Future<List<String>>
The directories directly in a directory.
download(String path, {String? name, Map<String, String>? headers, Request? request}) → Future<Response>

Available on Disk, provided by the DiskResponses extension

The file at path as an attachment.
exists(String path) → Future<bool>
Whether path exists.
files([String directory = '', bool recursive = false]) → Future<List<String>>
Files directly inside directory (or recursively).
get(String path) → Future<String>
The text at path.
getBytes(String path) → Future<Uint8List>
The bytes at path.
lastModified(String path) → Future<DateTime>
When path was last changed.
makeDirectory(String path) → Future<void>
Creates the directory path.
missing(String path) → Future<bool>
Whether path does not exist.
move(String from, String to) → Future<void>
Moves from to to.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
put(String path, Object contents) → Future<void>
Writes contents (String as UTF-8 or List<int>).
putStream(String path, Stream<List<int>> stream) → Future<void>
Writes stream to path without holding it in memory.
readStream(String path) → Stream<List<int>>
The bytes at path, streamed.
response(String path, {String? name, Map<String, String>? headers, Request? request}) → Future<Response>

Available on Disk, provided by the DiskResponses extension

The file at path, shown by the browser; with request, ranges too.
size(String path) → Future<int>
The size of path in bytes.
toString() → String
A string representation of this object.
inherited
url(String path) → String
Public URL (only for disks with a url).

Operators

operator ==(Object other) → bool
The equality operator.
inherited