I'm creating a web service, which run in GlassFish, and I want to have some custom properties. For this I'm using the Properties
class. The code I'm using is:
Properties p=new Properties();
File f=new File(System.getProperty("user.dir"), "settings.properties");
p.load(new FileInputStream(f));
But how do I get the settings.properties
-file in my config directory?
I'm not sure about my classpath, since this is managed by NetBeans and GlassFish. I assume my .war
-file is added to the classpath, when deploying...
I've added my own solution, but if anyone could come up with a better solution, it would be highly welcome...