openInBrowser

Opens the file in the default browser, when there is one to open it in.

On a machine with no display (a headless JVM, a CI runner, a server), or where the desktop cannot open a browser, the file is left where it is, its location is logged, and the call returns normally. A program that writes plots or reports therefore runs unchanged on a desktop and in a batch run. A failure of the browser itself is logged as a warning rather than thrown.

Parameters

file

the HTML file to open, must not be null


fun openInBrowser(fileName: String, html: String, dir: Path = KSL.outDir): File(source)

Opens the HTML file in the browser. The file is created in the specified directory with the given file name. The file will have a .html extension. If the directory does not exist, it will be created.

Return

the created temporary HTML file

Parameters

fileName

the name of the file, must not be null

html

the HTML string to write to the file, must not be null

dir

the directory to create the file in, defaults to KSL.outDir, must not be null