TemplatingUtil

Functions

Link copied to clipboard

Ensures we can satisfy all required template variables in the template.

Link copied to clipboard

Extracts all required template variables from the template string.

Link copied to clipboard
fun getResourceAsText(resourcePath: String): String?

Reads a resource file from the classpath and returns its content as a string.

Link copied to clipboard
fun renderTemplate(template: String, values: Map<String, String> = mapOf()): String

Reads a resource file from the classpath, replaces variables in the template with values from the map,

Link copied to clipboard
fun replaceVariables(template: String, values: Map<String, String>): String

Replaces ${key} and $key in the template string with the corresponding values from the map.