I am facing this issue while reading property file. I searched a lot on the Internet but nothing worked. Below is the code and the image contains the path of the prop.properties
file
package Utility;
import java.io.IOException;
import java.io.InputStream;
import java.util.Properties;
public class PropUtility {
//private static Properties prop;
private static Properties prop = new Properties();
static {
prop = new Properties();
InputStream in = prop.getClass().getResourceAsStream("/resources/prop.properties");
try {
prop.load(in);
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
public static String getProperty(String key) {
return prop.getProperty(key);
}
}