Skip to content

Instance Method

file(template:escape:on:)

Given a path name, return an EventLoopFuture holding a ByteBuffer
func file(template: String, escape: Bool, on eventLoop: any EventLoop) throws -> EventLoopFuture<ByteBuffer>

Parameters

template

Relative template name (eg: "path/to/template")

escape

If the adherent represents a filesystem or something scoped that enforces a concept of directories and sandboxing, whether to allow escaping the view directory

eventLoop

EventLoop on which to perform file access

Return Value

A succeeded EventLoopFuture holding a ByteBuffer with the raw template, or an appropriate failed state ELFuture (not found, illegal access, etc)