question: public String readFileContent ( File file ) { StringBuilder fileContentBuilder = new StringBuilder ( ) ; if ( file . exists ( ) ) { String stringLine ; try { FileReader fileReader = new FileReader ( file ) ; BufferedReader bufferedReader = new BufferedReader ( fileReader ) ; boolean newLine = false ; while ( ( stringLine = bufferedReader . readLine ( ) ) != null ) { if ( newLine ) { fileContentBuilder . append ( "\n" ) ; } fileContentBuilder . append ( stringLine ) ; newLine = true ; } bufferedReader . close ( ) ; fileReader . close ( ) ; } catch ( FileNotFoundException e ) { e . printStackTrace ( ) ; } catch ( IOException e ) { e . printStackTrace ( ) ; } } return fileContentBuilder . toString ( ) ; }
target:  Reads a content from a file. This is an I/O operation and this method executes in the main thread, so it is recommended to perform the operation using another thread.