chemin relatif ignoré avec FileInputStream
Bonjour
je load un fichier porperties avec FileInputStream voici le code:
Code:
1 2
|
private final static String FILE="C:\\WorkSpace\\toto\\titi\\src\\config\\tata.properties"; |
et la methode pour loader est la suivante :
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
|
/**
* Load configuration file
* @throws IOException if an error occurred when reading from the input stream.
*/
private void loadConfig(String path) throws IOException{
if(path != null)
pathConfig = path;
try {
Properties myProperties = new Properties();
myProperties.load(new FileInputStream(pathConfig));
}
catch(IOException e) {
PRINT.error(pathConfig+ " doesn't exist",e);
throw e;
}
} |
ça marche mais si j'essaie de mettre le chemin relatif qui contient mon fichier properties il plante.
le fichier proprteis est dans config qui est dans : qui a une idée de pourquoi ça plante.
merci