Skip to Main Content

Java Programming

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

How load properties file by using the relative path (not absolute path)?

user13329458Dec 8 2008 — edited Dec 18 2008
Hi!
I have the next properties file D:\development\\myproject\build\classes\config\systemsettings.properties.
In this file I have some settings. I load this propertie file:
	
...
private static Properties systemSettingsProps = new Properties();
...
private static final String SUFFIX_PATH_SYSTEMSETTINGS = "D:\\development\\myproject\\build\\classes\\config\\systemsettings.properties";
...
FileInputStream fileInputStreamSystemSettings = new FileInputStream(SUFFIX_PATH_SYSTEMSETTINGS);
systemSettingsProps.load(fileInputStreamSystemSettings);
fileInputStreamSystemSettings.close();
OK this work. But I want to load properties file by using the relative path (not absolute path). How I can do this?
I want to set only relative path something like this: "\\config\\systemsettings.properties" .
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jan 15 2009
Added on Dec 8 2008
24 comments
16,561 views