• Post Reply Bookmark Topic Watch Topic
  • New Topic

properties file  RSS feed

 
Tim Bowman
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello there,

I was tring to create a properties file for my applications. But I could not figure out where to keep it. I mean I am using eclipse for development so I was wondering whether I could create a props file in workspace or is there any there place for it. And if at all if we keep in the workspace, do we access it, same as we do access any file using File readers.Any ideas.

Thanks
TIm.
 
Ernest Friedman-Hill
author and iconoclast
Sheriff
Posts: 24217
38
Chrome Eclipse IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can keep it in the same directory as your source file and then use getClass().getResource() to read it.
 
Chengwei Lee
Ranch Hand
Posts: 884
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It would depends on which type of application Tim is working on right? Suppose it's a J2SE application, distributed in a Jar file, the properties file must be inside the Jar.

It would be different, if the application is a web application, or a EJB application.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!