private static void loadScript ( ScriptEngine engine , Supplier < Reader > scriptReader ) { try ( Reader reader = scriptReader . get ( ) ) { engine . eval ( reader ) ; } catch ( ScriptException | IOException e ) { throw new RuntimeException ( e ) ; } }
Loads a single script from an URL into the script engine