static protected String toString(File file,String encoding) throws FileNotFoundException {
  String script=null;
  Scanner scanner=null;
  try {
    scanner=new Scanner(file,encoding);
    scanner.useDelimiter("\\A");
    script=scanner.next();
  }
  finally {
    if (scanner != null) {
      scanner.close();
    }
  }
  return script;
}

static protected String toString ( File file , String encoding ) throws FileNotFoundException { String script = null ; Scanner scanner = null ; try { scanner = new Scanner ( file , encoding ) ; scanner . useDelimiter ( "\\A" ) ; script = scanner . next ( ) ; } finally { if ( scanner != null ) { scanner . close ( ) ; } } return script ; }
read a file with the specified encoding into a string
