FileHandler class

Handles file operations such as serving files and directories over HTTP.

Constructors

FileHandler({required String rootPath, FileSystem fileSystem = const local.LocalFileSystem(), bool allowDirectoryListing = false})
Factory constructor that handles path normalization.
factory
FileHandler.fromDir(Dir dir)
Factory constructor that creates a FileHandler from a Dir instance.
factory

Properties

allowDirectoryListing bool
Whether directory listing is allowed.
final
fileSystem → FileSystem
The file system to use.
final
hashCode int
The hash code for this object.
no setterinherited
rootPath String
The root path from which files are served.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
serveDirectory(EngineContext ctx, String dirPath, [String parent = '']) Future<void>
Serves a directory over HTTP.
serveFile(EngineContext ctx, String file) Future<void>
Serves a file over HTTP.
toString() String
A string representation of this object.
inherited

Operators

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