If you want to read in a file in your classpath (without exactly knowing 
where to find) you have to do following:

your.package.YourClass.class.getResourceAsStream("/yourconfig.cfg")

Note: The SLASH before configuration file name is important. Without it, 
java won't search for this file into your classpath.
It will then only look if this file is in the same folder, where your 
class lies:

YourClass.class.getResourceAsStream("yourconfig.cfg")
-->Config had to lie here /your/package/yourconfig.cfg

wbr,

Daniel Kuschow

Reply via email to