How to read a text file from resources in Kotlin? November 16, 2022 by Tarik val fileContent = MySpec::class.java.getResource("/html/file.html").readText()