createTempDirectory

Creates a temporary directory on the file system.

The absolute path of the created directory can be obtained by calling getAbsolutePath().asString().

The returned TempDirectory object implements AutoCloseable. Сall close() to close its file descriptor and delete the temporary directory when it is no longer needed. Set TempDirectory.deleteOnClose to false to preserve the directory, but close() must still be called.

The configuration block config can be used to customize the base path, name prefix, and other options.

Throws

on errors during directory creation.