FunkyMuse
02/05/2023, 6:00 PMresources
folder via java.io.File
when I run the app locally it works, but when I build the fatJar, this Folder is not available and an exception is thrown, what I’m doing wrong?
private val tempMailDirectory = Paths.get("").toAbsolutePath().toString() + "/src/main/resources/blacklisted_domains"
Mustafa Ozhan
02/05/2023, 6:04 PMjava.io.File
I have in my backend like this
javaClass.classLoader?.getResource("YOUR_PATH")?.readText()?.let{
// do your stuff
}
FunkyMuse
02/05/2023, 6:56 PMChrimaeon
02/05/2023, 7:14 PMFile
you can use the URL
retuned from ClassLoader#getResource(String name)
FunkyMuse
02/05/2023, 7:25 PM