Package org.ringojs.repository

Examples of org.ringojs.repository.Resource


                    break;
                }
                prompt = getSecondaryPrompt();
            }
            try {
                Resource res = new StringResource("<stdin>", source, lineno);
                ReloadableScript script = new ReloadableScript(res, engine);
                Object result = worker.evaluateScript(cx, script, scope);

                printResult(result, out);
                lineno++;
View Full Code Here


                lineno++;
                if (cx.stringIsCompilableUnit(source))
                    break;
            }
            try {
                Resource res = new StringResource("<stdin>", source, lineno);
                ReloadableScript script = new ReloadableScript(res, engine);
                worker.evaluateScript(cx, script, scope);
                lineno++;
            } catch (Exception ex) {
                RingoRunner.reportError(ex, System.err, worker.getErrors(),
View Full Code Here

            throw Context.reportRuntimeError(
                    "getResource() requires a string argument");
        }
        RhinoEngine engine = ((RingoGlobal) funObj.getParentScope()).engine;
        try {
            Resource res = engine.findResource((String) args[0], null,
                    engine.getParentRepository(thisObj));
            return cx.getWrapFactory().wrapAsJavaObject(cx, engine.getScope(),
                    res, null);
        } catch (IOException iox) {
            throw Context.reportRuntimeError("Cannot find resource " + args[0] + "'");
View Full Code Here

        String _path =  (path == null || path == Undefined.instance) ?
                "" : ScriptRuntime.toString(path);
        if (repository == null) {
            return _path;
        }
        Resource res = repository.getResource(_path);
        if (res == null) {
            return _path;
        } else if (res instanceof FileResource) {
            // Return absolute path for file resources
            return res.getPath();
        } else {
            // not a file, return relative path so it
            return res.getRelativePath();
        }
    }
View Full Code Here

TOP

Related Classes of org.ringojs.repository.Resource

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.