DefaultFileServer class

File server that serves files using dart:io framework. By default all files are returned without filtering.

NOTE: No security checks are performed on the input paths

Constructors

DefaultFileServer(String _root, String name, {String? icon})

Properties

hashCode int
The hash code for this object.
no setterinherited
icon String?
The icon to use for this server. Must be an svg or a base64 encoded png (square, preferably 16x16 or 32x32)
final
id String
Unique id for this session
final
name String
The name of this server, eg: the name of the preference file
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

browse(String root) Future<List<FileInfo>>
Recursively browse the file system at the given root. Returned paths are relative to the provided root and MUST ONLY contain leaf files or empty directories
delete(String path, {required bool recursive}) Future<void>
Delete the file system contents at the given path.
move({required String path, required String newPath}) Future<void>
Moves the contents at path to newPath
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
read(String path) Future<Uint8List>
Read the contents of the file at the given path
toString() String
A string representation of this object.
inherited
write(String path, Uint8List data) Future<void>
Writes the given bytes to the file at the given path. If the file/path does not exists, it will be created recursively

Operators

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