class LuaScriptEngine implements IScriptEngine {

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

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

        try {
            File relFile = FileUtils.getRelativeFile(file, new File("."));
            String scriptName = relFile.getPath().replace("\\", "/");

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

            this.execScript(scriptName);
        } catch (IOException e) {
            Log.e(SCRIPTS_TAG, "IOException while loading lua script file: ", e);
            throw new ScriptLoadException("Cannot read script file: " + file.getAbsolutePath() + ", IOException: " + e.getLocalizedMessage());
        } catch (CallException e) {
            throw new ScriptExecutionException(e);
        }
    }

    public  LuaScriptEngine();

}