File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Java in General and the fly likes How to set the location of the property file in the class path Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Java in General
Bookmark "How to set the location of the property file in the class path" Watch "How to set the location of the property file in the class path" New topic
Author

How to set the location of the property file in the class path

Sat Nar
Ranch Hand

Joined: Oct 22, 2004
Posts: 83
Hi,
i need to read a property file.If i give the full path say "c:\example\test.properties" its working fine.But in the code i need to only mention the property file name and set the path of this property file in the class path.

say

Properties prop = new Properties(new FileInputStream("test.properties");

and the location c:\example should not be specified here.It should be automatically detected.I tried setting this in the classpath but still it cannot recognise the file location.Kindly help me out.
Sunil Kumar Gupta
Ranch Hand

Joined: Aug 26, 2005
Posts: 824
check this

http://www.javaworld.com/javaworld/javaqa/2003-08/01-qa-0808-property.html


Lack of will power has caused more failure than lack of intelligence or ability.
My Blog | Red5 Resources | Technology Update | Daily Technology Tips
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How to set the location of the property file in the class path