Hi, I’m a big noob, so I would like some kind help
In my intellij project, I’m trying to access and open an .sql file in a folder in src/main/kotlin. I do NOT want to open these files from the special resources folder.
I tried
val txt = File("./sql/CreateActivity.sql").readText(Charsets.UTF_8)
But apparently, it doesn’t work with the smart dot. I also tried “src/main/kotlin/sql/CreateActivity.sql”
It gives me an exception. I tried looking in stack overflow but ALL I found was code to access resources or open file in the same directory as the file running the code… this is the most important point. Is there some regex to help it do some smart locale to find the file?
I want to do this because I have a folder with .sql, so I want to read it as a string file and give as input to functions to execute as sql statements.
Thanks!!!