File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

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

 
Sat Nar
Ranch Hand
Posts: 83
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 824
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
check this

http://www.javaworld.com/javaworld/javaqa/2003-08/01-qa-0808-property.html
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic