Hey

I know this isn't exactly Java related, but I'm having an issue with the structure of my project in Eclipse.
The structure goes:
-Project folder
--bin
---com
----test
-----Main.class
--res
---spriteSheet.png
--src
---com
----test
-----Main.java
The issue is that I'm unable to read the spriteSheet.png file inside the res folder from the Main.class file inside the bin folder using the following line inside the Main class:
1
| image = ImageIO.read(getClass().getClassLoader().getResourceAsStream("../../../res/spriteSheet.png")); |
I've tried this among other combinations, but it keeps producing this error:
Exception in thread "main" java.lang.IllegalArgumentException: input == null!
at javax.imageio.ImageIO.read(Unknown Source)
at com.test.Main.<init>(Main.java:15)
It works when I move the res folder inside the bin folder, although I've had issues doing it that way in the past where the folder has been wiped.
Is this a poor project structure and if so, could somebody explain to me what a good structure would be and also why this is producing an error?
Thanks,
Paul