File tree Expand file tree Collapse file tree 1 file changed +5
-2
lines changed
Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Original file line number Diff line number Diff line change @@ -48,8 +48,11 @@ private RepertoireCommune() {
4848 private static List <Commune > initCommunes () {
4949 List <Commune > result = null ;
5050 try {
51- result = new CsvToBeanBuilder <Commune >(new FileReader ("communes.csv" )).withType (Commune .class ).build ()
52- .parse ();
51+ InputStream resource = RepertoireCommune .class .getClassLoader ().getResourceAsStream ("communes.csv" );
52+ if (resource == null )
53+ throw new FileNotFoundException ();
54+ Reader reader = new InputStreamReader (resource );
55+ result = new CsvToBeanBuilder <Commune >(reader ).withType (Commune .class ).build ().parse ();
5356 } catch (IllegalStateException | FileNotFoundException e ) {
5457 log .error ("Le fichier contenant les communes n'a pas été trouvé" , e );
5558 }
You can’t perform that action at this time.
0 commit comments