I have .tpl file containing some static content in a package in src. e.g. src/A/B/C/test.tpl and i'm trying to read it from a class sibling that file (src/A/B/C/Test).
I can't find it in any way! FileReader throws FileNotFoundException.
SOLUTION: Class.getResource() works. Problem is about tpl extension which will not be compiled by default. IDEs have setting to add extensions to compile. I used .html instead of updating compiler settings.
Test.class.getResource("/A/B/C/test.html").getPath().replace("%20", " ")