I have a method :
private String getProperty(String property) throws IOException,ConfigException{
//first test if the config file exists.
String propertyFile = "DataTransfer/Config/DataTransfer.properties";
if(!new File(propertyFile).exists()){
throw new ConfigException("the config file doesn't exist." +
" Make sure the file : \""+propertyFile+"\" exists.");
}
//retrieve the property
Properties configFile = new Properties();
configFile.load(this.getClass().getClassLoader()
.getResourceAsStream(propertyFile));
String prop = configFile.getProperty(property);
return prop;
}
unfortunately, I keep getting a java.lang.NullPointerException at the ConfigFile.load() level.
I checked my variables in debug mode, none of them is null.
I don't know what's the cause for this exception.