mending3
02/16/2021, 12:53 PMgetResource
give me null?
I have a .txt
file in the same directory with MyClass.java
I print the class with this code
println(MyClass::class.java)
it returns me class com.myapp.vendors.lib.MyClass
However when I want to get the txt file with this code:
println(MyClass::class.java.getResource("my.txt"))
it returns me nulledrd
02/16/2021, 1:03 PMresources
dir (or whatever dir is configured in your build file), not beside .java
files:
src/
main/
java/
MyClass.java
resources/
my.txt
edrd
02/16/2021, 1:05 PMMarc Knaup
02/16/2021, 2:58 PMsrc/resources/com/myapp/vendors/lib/my.txt
to be precise 🙂edrd
02/16/2021, 4:13 PM