public static String readFileToString(Path file) throws IOException {
  byte[] fileArray=Files.readAllBytes(file);
  return new String(fileArray,StandardCharsets.UTF_8);
}

public static String readFileToString ( Path file ) throws IOException { byte [ ] fileArray = Files . readAllBytes ( file ) ; return new String ( fileArray , StandardCharsets . UTF_8 ) ; }
java nio replacement of commons - io
