Package org.jaggeryjs.scriptengine.exceptions

Examples of org.jaggeryjs.scriptengine.exceptions.ScriptException


            byte[] arr = new byte[(int) min(count, file.length())];
            file.readFully(arr);
            return new String(arr, "UTF-8");
        } catch (IOException e) {
            log.error(e.getMessage(), e);
            throw new ScriptException(e);
        }
    }
View Full Code Here


        }
        try {
            file.writeBytes(data);
        } catch (IOException e) {
            log.error(e.getMessage(), e);
            throw new ScriptException(e);
        }
    }
View Full Code Here

        }
        try {
            IOUtils.copy(data, new FileOutputStream(file.getFD()));
        } catch (IOException e) {
            log.error(e.getMessage(), e);
            throw new ScriptException(e);
        }
    }
View Full Code Here

            String data = read(file.length());
            file.seek(pointer);
            return data;
        } catch (IOException e) {
            log.error(e.getMessage(), e);
            throw new ScriptException(e);
        }
    }
View Full Code Here

        try {
            open("r");
            return new FileInputStream(file.getFD());
        } catch (IOException e) {
            log.error(e.getMessage(), e);
            throw new ScriptException(e);
        }
    }
View Full Code Here

        try {
            open("w");
            return new FileOutputStream(file.getFD());
        } catch (IOException e) {
            log.error(e.getMessage(), e);
            throw new ScriptException(e);
        }
    }
View Full Code Here

            modules.put(moduleName, module);
        } catch (XMLStreamException e) {
            String msg = "Error while reading the module.xml";
            log.error(msg, e);
            throw new ScriptException(msg, e);
        } finally {
            RhinoEngine.exitContext();
        }
    }
View Full Code Here

                    public CodeSource getCodeSource() throws ScriptException {
                        try {
                            URL url = new File(fileName).getCanonicalFile().toURI().toURL();
                            return new CodeSource(url, (Certificate[]) null);
                        } catch (MalformedURLException e) {
                            throw new ScriptException(e);
                        } catch (IOException e) {
                            throw new ScriptException(e);
                        }
                    }
                });
                sctx.setSourceModifiedTime(1);

                Script cachedScript = cacheManager.getScriptObject(reader, sctx);
                if (cachedScript == null) {
                    cacheManager.cacheScript(reader, sctx);
                    cachedScript = cacheManager.getScriptObject(reader, sctx);
                }
                script.setScript(cachedScript);
                module.addScript(script);
            } catch (FileNotFoundException e) {
                String msg = "Error executing script. Script cannot be found, name : " + name + ", path : " + path;
                log.error(msg, e);
                throw new ScriptException(msg, e);
            }
        }
    }
View Full Code Here

            includesCallstack.push(fileURL);
            engine.exec(source, scope, null);
            includesCallstack.pop();
        } catch (FileNotFoundException e) {
            log.error(e.getMessage(), e);
            throw new ScriptException(e);
        }
    }
View Full Code Here

            includesCallstack.push(fileURL);
            engine.exec(source, scope, null);
            includesCallstack.pop();
        } catch (FileNotFoundException e) {
            log.error(e.getMessage(), e);
            throw new ScriptException(e);
        }
    }
View Full Code Here

TOP

Related Classes of org.jaggeryjs.scriptengine.exceptions.ScriptException

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.