class JSRhinoScriptEngine implements IScriptEngine {

    @Override
    public void loadFile(File file) throws ScriptLoadException {
        Objects.requireNonNull(file);

        if (!file.exists()) {
            throw new ScriptLoadException("js script file doesn't exists: " + file.getAbsolutePath());
        }

        ExceptionUtils.throwSLEOnException(SCRIPTS_TAG, "Cannot read script file: " + file.getAbsolutePath() + ", IOException: ", () -> {
            File relFile = FileUtils.getRelativeFile(file, new File("."));
            String scriptName = relFile.getPath().replace("\\", "/");

            //only compile this file, if it isn't in cache
            if (!this.scripts.containsKey(scriptName)) {
                String content = FileUtils.readFile(file.getAbsolutePath(), StandardCharsets.UTF_8);
                this.compile(scriptName, content);
            }

            this.execScript(scriptName);
        });
    }

    public  JSRhinoScriptEngine();

}