public static List < String > readToList ( File f ) throws IOException { try ( final Reader reader = asReaderUTF8Lenient ( new FileInputStream ( f ) ) ) { return readToList ( reader ) ; } catch ( IOException ioe ) { throw new IllegalStateException ( String . format ( "Failed to read %s: %s" , f . getAbsolutePath ( ) , ioe ) , ioe ) ; } }
Read the file line for line and return the result in a list