Tengo un mvn project, tengo el config.properties en los resources y quiero llamarlo en el main
public class GetProperties {
private Properties prop = new Properties();
public GetProperties() {
InputStream in =
getClass().getResourceAsStream("/config.properties");
try {
prop.load(in);
} catch (FileNotFoundException e) {
System.out.println("The property file was not found");
} catch (IOException e) {
System.out.println("Can not read property file");
}
}
public String getPropValues( String propertyName){
return prop.getProperty(propertyName);
}
}
Ese es mi clase GetProperties, pero me da Null Pointer Exception