FileCallback

class FileCallback(file: File) : Function1<HttpContext, HttpContext>

Callback that resolves requests' path parameters to files based on a base file. Requests path parameters are not allowed to contain .. (references to file parent directories are not permitted).

If request does not have path parameters file will be returned (or not found if file is a directory).

Parameters

file

Base file used to resolve paths passed on the request.

Constructors

Link copied to clipboard
constructor(file: String)
constructor(file: File)

Functions

Link copied to clipboard
open operator override fun invoke(context: HttpContext): HttpContext