Package org.jaggeryjs.scriptengine.exceptions

Examples of org.jaggeryjs.scriptengine.exceptions.ScriptException


            }
            return rho.content;
        } catch (IOException e) {
            String msg = "Error occurred while reading Servlet InputStream";
            log.warn(msg, e);
            throw new ScriptException(msg, e);
        }
    }
View Full Code Here


        try {
            return cx.newObject(thisObj, "Stream", new Object[]{rho.request.getInputStream()});
        } catch (IOException e) {
            String msg = "Error occurred while reading Servlet InputStream";
            log.warn(msg, e);
            throw new ScriptException(msg, e);
        }
    }
View Full Code Here

        try {
            return rho.request.getInputStream();
        } catch (IOException e) {
            String msg = "Error occurred while reading Servlet InputStream";
            log.warn(msg, e);
            throw new ScriptException(msg, e);
        }
    }
View Full Code Here

        }
        try {
            return item.getString((String) args[1]);
        } catch (UnsupportedEncodingException e) {
            log.error(e.getMessage(), e);
            throw new ScriptException(e);
        }
    }
View Full Code Here

        List items = null;
        try {
            items = upload.parseRequest(rho.request);
        } catch (FileUploadException e) {
            log.error(e.getMessage(), e);
            throw new ScriptException(e);
        }
        // Process the uploaded items
        String name;
        rho.files = rho.context.newObject(rho);
        for (Object obj : items) {
View Full Code Here

        for (String name : rho.parameterMap.keySet()) {
            try {
                rho.parameters.put(name, rho.parameters, rho.parameterMap.get(name).getString(encoding));
            } catch (UnsupportedEncodingException e) {
                log.error(e.getMessage(), e);
                throw new ScriptException(e);
            }
        }
    }
View Full Code Here

                                           boolean inNewExpr) throws ScriptException {
        if (args.length == 1) {
            if (args[0] instanceof Resource && !(args[0] instanceof Scriptable)) {
                return new ResourceHostObject((Resource) args[0], cx);
            } else if (args[0] instanceof Scriptable) {
                throw new ScriptException("Resource object cannot be initialized directly, " +
                        "use registry.newResource() instead");
            } else {
                throw new ScriptException("Invalid argument type for Resource constructor");
            }
        } else {
            throw new ScriptException("Resource object cannot be initialized directly, use " +
                    "registry.newResource() instead");
        }
    }
View Full Code Here

        ResourceHostObject resourceHostObject = (ResourceHostObject) thisObj;
        if (arguments.length == 2) {
            if (arguments[0] instanceof String && arguments[1] instanceof String) {
                resourceHostObject.resource.addProperty((String) arguments[0], (String) arguments[1]);
            } else {
                throw new ScriptException("Invalid argument types for addProperty() method");
            }
        } else {
            throw new ScriptException("Invalid no. of arguments for addProperty() method");
        }
    }
View Full Code Here

        ResourceHostObject resourceHostObject = (ResourceHostObject) thisObj;
        if (arguments.length == 1) {
            if (arguments[0] instanceof String) {
                return resourceHostObject.resource.getProperty((String) arguments[0]);
            } else {
                throw new ScriptException("Invalid argument type for getProperty() method");
            }
        } else {
            throw new ScriptException("Invalid no. of arguments for getProperty() method");
        }
    }
View Full Code Here

        ResourceHostObject resourceHostObject = (ResourceHostObject) thisObj;
        if (arguments.length == 1) {
            if (arguments[0] instanceof String) {
                return cx.newArray(thisObj, resourceHostObject.resource.getPropertyValues((String) arguments[0]).toArray());
            } else {
                throw new ScriptException("Invalid argument type for getProperty() method");
            }
        } else {
            throw new ScriptException("Invalid no. of arguments for getProperty() method");
        }
    }
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.