public ImmutableList < String > readLines ( ) throws IOException { Closer closer = Closer . create ( ) ; try { BufferedReader reader = closer . register ( openBufferedStream ( ) ) ; List < String > result = Lists . newArrayList ( ) ; String line ; while ( ( line = reader . readLine ( ) ) != null ) { result . add ( line ) ; } return ImmutableList . copyOf ( result ) ; } catch ( Throwable e ) { throw closer . rethrow ( e ) ; } finally { closer . close ( ) ; } }
Reads all the lines of this source as a list of strings . The returned list will be empty if this source is empty .