I have a small Java project in eclipse. The project has a src and bin folder (typical), and src is added to the class path. I work in windows.
The following call is made:
System.out.println(TestINI.class.getResource("happytest.ini"));
It prints the file path:
file:/D:/work/baton/Touch/JTouch/bin/com/interra/tests/happytest.ini
I checked that the contents of the ini file mentioned above were expecting the contents.
But reading from a file looks like this:
InputStream is = TestINI.class.getResourceAsStream("happytest.ini");
gives me an input stream that has no content. that is, it returns a file with zero bytes.
My Eclipse is a 64-bit 64-bit Helios server running on Windows 7.
A Google search revealed cases where the resource path or input stream was null, but this is not the case.
The class path entries are as follows:
<classpathentry kind="src" path="src"/> ... other class path entries for libraries like ini4j <classpathentry kind="output" path="bin"/>
source share