File file = null;
Properties properties = new Properties();
String propertyFileName = "\\test-config.properties";
Properties systemProps = System.getProperties();
if (systemProps.containsKey("config.dir")) {
String FileName = systemProps.get("config.dir") + propertyFileName;
try {
FileInputStream is = new FileInputStream(systemProps.get("config.dir") + propertyFileName);
try {
properties.load(is);
String firstname = properties.getProperty("firstname");
System.out.println("firstname : " +firstname );
} catch (IOException e) {
e.printStackTrace();
}
} catch (FileNotFoundException e) {
e.printStackTrace();
}
}