Lire un fichier

static String readFile(String fileName) {

      try {

            // read all bytes

            byte[] bytes = Files.readAllBytes(Paths.get(fileName));

            // convert bytes to string

            String chaine = new String(bytes);

            return chaine;

      } catch (IOException ex) {

            ex.printStackTrace();

      }

      return null;

}