Code Comments
Programming Forum and web based access to our favorite programming groups.I am trying to read a property file.. using the code,
properties.load(new FileInputStream("SessionInit.properties"));
this property file is in the same package as my source file... still it
gives me FileNotFoundException.
i have tried giving ./SessionInit.properties and different other
options.. but still gives the trouble.. i am using jkd 1.5 and netbeans
IDE v 5.0
thanks in advance.
sarath
Post Follow-up to this message"sarath" <sarath.post@gmail.com> wrote in message
news:1138342537.065871.27510@g47g2000cwa.googlegroups.com...
> I am trying to read a property file.. using the code,
>
> properties.load(new FileInputStream("SessionInit.properties"));
>
> this property file is in the same package as my source file... still it
> gives me FileNotFoundException.
>
> i have tried giving ./SessionInit.properties and different other
> options.. but still gives the trouble.. i am using jkd 1.5 and netbeans
> IDE v 5.0
>
>
>
> thanks in advance.
> sarath
>
The file needs to be relative to System.getProperty("user.dir").
Also, your code will leak the file resource if you do not maintain a
reference and call close() in a finally block.
--
Tony Morris
http://tmorris.net/
Post Follow-up to this message
Show a Printable Version
Email This Page to Someone!
Receive updates to this thread
Powered by vBulletin
Copyright 2000-2006 Jelsoft Enterprises Limited.