Loading a property file from a fixed folder in the filesystem
Joined: Nov 17, 2011
I have a file called outbound.properties that I load in my Java application. This file at the moment is in the /src directory of my project and I load it using something like:
InputStream input = MailService.class.getResourceAsStream(Constants.Session.OUTBOUND_PROPERTIES_FILE); where OUTBOUND_PROPERTIES_FILE is define as "/outbound.properties/ and is the name of the file and it all work prefectly !
Now, I would like to put the property file outside my project folder, for example in the folder C:\data of my filesystem. I tried to change the name of the OUTBOUND_PROPERTIES_FILE in "C:\data" but I get a
WARNING: Configuration file:/data/outbound.properties not found, using defaults. Of course the file it is there !
How can I load a java property file from an absolute path in my filesystem, for example C:\data\myConfigFiles ?