I use this code snippet to obtain a file as an input stream. The file version.txt is packaged in my app's jar, in the upper-most folder.
InputStream resource = getClass().getClassLoader().getResourceAsStream("version.txt");
This works almost all of the time. But for one user, it's picking up another version.txt, that's not in my jar. How can I ensure that this loads the specific version.txt file that is in my jar?