Seems your code for setting the property is not implemented, But you can simply Open a file using following code.
Properties p = new Properties();
public Properties getObjectRepository() throws IOException{
//Read object repository file
String FileName="Path to your file";
InputStream stream = new FileInputStream(new File(fileName));
//load all objects
p.load(stream);
return p;
}
Or otherwise, you should get it from system properties..
Properties p = new Properties();
public Properties getObjectRepository() throws IOException{
//Read object repository file
String FileName=System.getProperty("Prperty Key for your file path"); // the property should ave been already set somewhere in the code before execution of this line
InputStream stream = new FileInputStream(new File(fileName));
//load all objects
p.load(stream);
return p;
}
This is for setting the property and accessing the file
Properties p = new Properties();
public Properties getObjectRepository() throws IOException{
//Set Property for file path
setProperty("filePath","D:\\src\\objects\\object.properties");
//Read object repository file
String FileName=System.getProperty("filePath"); //now fileName is similar to "D:\\src\\objects\\object.properties"
InputStream stream = new FileInputStream(new File(fileName));
//load all objects
p.load(stream);
return p;
}
"D:\\src\\objects\\object.properties"I guess. ingetPropertyyou do not specify the property file.