Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- fun readContent(fileNameWithExt: String): String? {
- return try {
- val classLoader = javaClass.classLoader
- val resource = classLoader.getResource(fileNameWithExt)
- val file = File(resource.file)
- file.readText()
- } catch (e: Exception) {
- null
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement