I have a gradle-based java project with this structure
. ├── myproject │ ├── src │ | └── main │ | ├── java │ | └── resourc
http://docs.oracle.com/javase/7/docs/api/java/lang/Class.html#getResource(java.lang.String)
For example something like MyMain.class.getResource("/config.txt") or use relative path when appropriate.
MyMain.class.getResource("/config.txt")