public static void runScript(final File file,final List<Pair<String,Object>> bindings) throws ScriptException, IOException {
  final ScriptEngine engine=manager.getEngineByExtension(FileUtils.getFileExtension(file));
  Preconditions.checkNotNull(engine,"Error: Script %s has an unknown extension.",file.getAbsolutePath());
  final String script=FileUtils.readTextfile(file);
  runScript(engine,script,bindings);
}

public static void runScript ( final File file , final List < Pair < String , Object > > bindings ) throws ScriptException , IOException { final ScriptEngine engine = manager . getEngineByExtension ( FileUtils . getFileExtension ( file ) ) ; Preconditions . checkNotNull ( engine , "Error: Script %s has an unknown extension." , file . getAbsolutePath ( ) ) ; final String script = FileUtils . readTextfile ( file ) ; runScript ( engine , script , bindings ) ; }
executes a script file . the language of the script is determined by the file extension .
