Here\'s my structure:
I can read the file in my Eclipse project, but
You can't get a File
for the file because it's in a jar file. But you can get an input stream:
InputStream in = ValueReader.class.getResourceAsStream("resources/values.xml");
getResourceAsStream
and getResource
convert the package of the class to a file path, then add on the argument. This will give a stream for the file at path /com/mycompany/resources/values.xml
.