VirtualDirectory class Null safety

A VirtualDirectory can serve files and directory-listing from a root path, to HttpRequests.

The VirtualDirectory providing secure handling of request uris and file-system links, correct mime-types and custom error pages.

Constructors

VirtualDirectory(String root, {String? pathPrefix})
Create a new VirtualDirectory for serving static file content of the path root. [...]

Properties

allowDirectoryListing bool
Whether to allow listing files in a directories. [...]
read / write
directoryHandler ← void Function(Directory, HttpRequest)
Overrides the default directory listing. [...]
write-only
errorPageHandler ← void Function(HttpRequest)
Overrides the default error handle. [...]
write-only
Whether to allow reading resources via a link.
read / write
hashCode int
The hash code for this object. [...]
read-only, inherited
jailRoot bool
Whether to prevent access outside of root via relative paths or links.
read / write
root String
final
runtimeType Type
A representation of the runtime type of the object.
read-only, inherited

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a non-existent method or property is accessed. [...]
inherited
serve(Stream<HttpRequest> requests) StreamSubscription<HttpRequest>
Serve a Stream of HttpRequests, in this VirtualDirectory.
serveFile(File file, HttpRequest request) → void
Serve the content of file to request. [...]
serveRequest(HttpRequest request) Future
Serve a single HttpRequest, in this VirtualDirectory.
toString() String
A string representation of this object. [...]
inherited

Operators

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