question: public static String readFileContents ( File file ) { StringBuilder scriptText = new StringBuilder ( ) ; String newLine = System . getProperty ( "line.separator" ) ; Scanner scanner = null ; try { scanner = new Scanner ( new FileInputStream ( file ) ) ; while ( scanner . hasNextLine ( ) ) { scriptText . append ( scanner . nextLine ( ) + newLine ) ; } } catch ( FileNotFoundException e ) { e . printStackTrace ( ) ; } finally { scanner . close ( ) ; } return scriptText . toString ( ) ; }
target:  Returns the contents of a file as a String.