tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Craig R. McClanahan" <craig...@apache.org>
Subject RE: Properties file [SOLVED?]
Date Wed, 26 Feb 2003 19:37:04 GMT


On Wed, 26 Feb 2003, José Moreira wrote:

> Date: Wed, 26 Feb 2003 16:31:23 -0000
> From: José Moreira <jmoreira@e-terno.net>
> Reply-To: Tomcat Users List <tomcat-user@jakarta.apache.org>
> To: Tomcat Users List <tomcat-user@jakarta.apache.org>
> Subject: RE: Properties file [SOLVED?]
>
> still didnt work ...
>
> my code :\
>
> String path =
> this.getClass().getClassLoader().getResource("config.properties").getPath().
> toString();
>
> FileInputStream in = new FileInputStream(path);
>
> properties.load(in);
>

You are working too hard.  :-)

InputStream is = getClass().getResourceAsStream("config.properties");
properties.load(is);

Craig

---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org


Mime
View raw message