public static String readFileWithExceptions(final File file) throws IOException {
  final BufferedReader in=new BufferedReader(new FileReader(file));
  final StringBuilder sb=new StringBuilder();
  String content="";
  boolean firstline=true;
  do {
    sb.append(content);
    content=in.readLine();
    if (content != null && !firstline) {
      sb.append(StringLiterals.NEWLINE);
    }
    firstline=false;
  }
 while (content != null);
  in.close();
  return sb.toString();
}

public static String readFileWithExceptions ( final File file ) throws IOException { final BufferedReader in = new BufferedReader ( new FileReader ( file ) ) ; final StringBuilder sb = new StringBuilder ( ) ; String content = "" ; boolean firstline = true ; do { sb . append ( content ) ; content = in . readLine ( ) ; if ( content != null && ! firstline ) { sb . append ( StringLiterals . NEWLINE ) ; } firstline = false ; } while ( content != null ) ; in . close ( ) ; return sb . toString ( ) ; }
reads given file . throws exceptions on error .
