My build path in Eclipse looks like this:
ProjectName
-- WEB-INF
-- classes
-- myClass.class
-- configs
-- myConfig.xml
My absolute path to the config currently looks like this:
C:\Development\Java\ProjectName\WEB-INF\configs\myConfig.xml
I'm using JAXB for the binding, and it is expecting a FileInputStream. The FileInputStream needs to be a stream for the XML config file. However, I can't figure out how to get the FileInputStream for my config, and I keep getting a FileNotFoundException.
I want this config to be loaded in such a way that someone doesn't have to hardcode the path to the config because I plan on releasing the project open source. I see a lot of examples where someone just hardcodes the full absolute path, but I need it to be something more flexible "like" this:
new FileInputStream("/WEB-INF/configs/myConfig.xml");
Thanks!