This content has been marked as final.
Show 2 replies
-
1. Re: read in packaged properties file
peterj Dec 20, 2006 12:14 PM (in response to siddharthags)You stated "props file packaged as" which I assume means that your poroperties file in within a jar file. Assuming your jar file has the following contents:
org/foo/bar/Some.class
org/foo/Other.class
org/foo/sysprops.properties
then from any of the classes in this jar file, you can load the properties file by:
Properties prop = new Properties();
prop.load(this.getClass().getResourceAsStream("org.foo.sysprops")); -
2. Re: read in packaged properties file
siddharthags Dec 21, 2006 12:05 PM (in response to siddharthags)thanks Peter that works with the addition that I have to give the absolute ath of the properties file beginning with a /.