public static String readFileContents ( File file ) throws IOException { try ( Scanner in = new Scanner ( file ) ) { in . useDelimiter ( "\\Z" ) ; return ( in . next ( ) ) ; } }
Reads the contents of a File to a String .