Hi gang I'd like to retrieve information from files in the classpath of the running VM - e.g. .properties files. Is there a way of doing this without having to supply the physical location of the file on disk? Thanks Felix.
You can get the information of your environment using System.getProperties(). The return type is java.util.Properties. I hope you can get information on the classpath also using this. Good Luck
Originally posted by Felix Ulrich: Hi gang I'd like to retrieve information from files in the classpath of the running VM - e.g. .properties files. Is there a way of doing this without having to supply the physical location of the file on disk? Thanks Felix.
I'm afraid that's not much help - it only get System properties - e.g. user.dir, os.version, etc. I want to include a something.conf file in my classpath, and then load it from within my application, without using the File stuff in java.io. Felix.
THere's a get resourec or some such in either Class or ClassLoader (CL is my guess). I used it just the other day. (Sorry this is deliberately vague but I'm tired and it's kinder than rtfm... ) Dave
Thanks Dave - that's kind of what I've been trying: InputStream is = ClassLoader.getSystemClassLoader().getSystemResourceAsStream("/db.conf"); I've also tried just getResourceAsStream(), but the input stream returned is null, and I know for sure that the file has stuff in it and that it is in the root of the classpath. Felix =(