Help needed to load relative path of file
703705Mar 7 2011 — edited Mar 7 2011Hi,
I am new to java. I am trying to load a properties file from the root level of my project in workspace. I am using below code to get the relative path of my file
File appPath = new File(System.getProperty("user.dir"));
Properties props = new Properties();
props.load ( new FileInputStream ( new File (appPath +"/xyz.properties" )));
but this loads the current working directory of eclipse and not the path of my workspace where properties file is kept.I do not want to change the current working directory of eclipse physically as the project will be used on other systems as well. I just want to get it done thru coding. Can you please help me out.
Thanks in advance!