Skip to content

Initializer

init(fileio:limits:sandboxDirectory:viewDirectory:defaultExtension:)

Initialize NIOLeafFiles with a NIO file IO object, limit options, and sandbox/view dirs
init(fileio _: NonBlockingFileIO, limits: NIOLeafFiles.Limit = .default, sandboxDirectory: String = "/", viewDirectory: String = "/", defaultExtension: String = "leaf")

Parameters

fileio

NonBlockingFileIO file object. This is no longer used but must still be passed.

limits

Options for constraining which files may be read - see NIOLeafFiles.Limit

sandboxDirectory

Full path of the lowest directory which may be escaped to

viewDirectory

Full path of the default directory templates are relative to

defaultExtension

The default extension inferred files will have (defaults to leaf)

Discussion

viewDirectory must be contained within (or overlap) sandboxDirectory