If you only specify "token.txt"
it will refer to the root directory of the project not to the directory of the class that is calling. Here you can see
how you can specify paths (example is in java but that is the library that kotlin JVM is using)
So in your case if you want to keep file next to the class it will probably look something like
File("src/main/kotlin/token.txt")
Or whatever your file structure looks like
Edit to explain your comment File("token.txt").absolutePath
will return the path as the string and calling reader().readLines()
on that will just read that returned string(path) not the contents