HTTPFileController class

Serves files from a directory on the filesystem.

See the constructor for usage.

Inheritance

Constructors

HTTPFileController(String pathOfDirectoryToServe, { Future<Response> onFileNotFound(HTTPFileController controller, Request req) })
Creates an instance of this type that serves files from pathOfDirectoryToServe. [...]

Properties

documentableChild APIDocumentable
Returns the next documentable object in a chain of documentable objects. [...]
read-only, inherited
hashCode int
The hash code for this object. [...]
read-only, inherited
logger Logger
An instance of the 'aqueduct' logger.
read-only, inherited
nextController RequestController
Receives requests that this controller does not respond to. [...]
read-only, inherited
policy CORSPolicy
The CORS policy of this controller.
read / write, inherited
runtimeType Type
A representation of the runtime type of the object.
read-only, inherited

Methods

addCachePolicy(HTTPCachePolicy policy, bool shouldApplyToPath(String path)) → void
Add a cache policy for file paths that return true for shouldApplyToPath. [...]
cachePolicyForPath(String path) HTTPCachePolicy
Returns the HTTPCachePolicy for path. [...]
contentTypeForExtension(String extension) ContentType
Returns a ContentType for a file extension. [...]
processRequest(Request request) Future<RequestOrResponse>
Overridden by subclasses to modify or respond to an incoming request. [...]
setContentTypeForExtension(String extension, ContentType contentType) → void
Sets the associated content type for a file extension. [...]
applyCORSHeadersIfNecessary(Request req, Response resp) → void
inherited
documentAPI(PackagePathResolver resolver) APIDocument
Returns an entire APIDocument describing an OpenAPI specification. [...]
inherited
documentOperations(PackagePathResolver resolver) List<APIOperation>
Returns all APIOperations this object knows about.
inherited
documentPaths(PackagePathResolver resolver) List<APIPath>
Returns all APIPath objects this instance knows about. [...]
inherited
documentRequestBodyForOperation(APIOperation operation) APIRequestBody
Returns all APIRequestBodys for operation.
inherited
documentResponsesForOperation(APIOperation operation) List<APIResponse>
Returns all APIResponses for operation.
inherited
documentSecuritySchemes(PackagePathResolver resolver) Map<String, APISecurityScheme>
Returns all APISecuritySchemes this instance knows about.
inherited
generate(RequestController instantiator()) RequestController
Sets the nextController that will receive a request after this one. [...]
inherited
handleError(Request request, dynamic caughtValue, StackTrace trace) Future<bool>
Sends an HTTP response for a request that yields an exception or error. [...]
inherited
listen(FutureOr<RequestOrResponse> process(Request request)) RequestController
Sets the nextController that will receive a request after this one. [...]
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a non-existent method or property is accessed. [...]
inherited
pipe(RequestController next) RequestController
Sets the nextController that will receive a request after this one. [...]
inherited
receive(Request req) Future
Delivers req to this instance to be processed. [...]
inherited
toString() String
Returns a string representation of this object.
inherited
willSendResponse(Response response) → void
Executed prior to Response being sent. [...]
inherited

Operators

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