I am running into the following issue when trying to parse in an XML file into my Kotlin Application:
java.io.FileNotFoundException: /src/main/res/locations.xml: open failed: ENOENT (No such file or directory)
Below is the code responsible for handling the file loading:
fun parseToObject() {
val thread = Thread(Runnable {
try {
val xml = File("src/main/res/locations.xml")
val doc = DocumentBuilderFactory.newInstance().newDocumentBuilder().parse(xml)
println("Root Node: " + doc.documentElement.nodeName)
} catch (e: Exception) {
print(e.message)
}
})
thread.start()
}
Anyone know what I might be doing wrong? I've tried using full paths as well as shorter ones and it just seems to not like any of them.