Package org.jaggeryjs.hostobjects.file

Examples of org.jaggeryjs.hostobjects.file.FileHostObject


    public static Scriptable jsFunction_writeTo(Context cx, Scriptable thisObj,
                                                Object[] arguments, Function funObj) throws ScriptException {

        FeedHostObject feedObject = (FeedHostObject) thisObj;
        FileHostObject fileHostObject;
        OutputStreamWriter outputStreamWriter = null;
        try {
            if (arguments[0] instanceof String) {
                fileHostObject = (FileHostObject) cx.newObject(feedObject,
                        "File", arguments);
                outputStreamWriter = new OutputStreamWriter(
                        fileHostObject.getOutputStream());
                feedObject.feed.writeTo(outputStreamWriter);
                outputStreamWriter.flush();
            } else if (arguments[0] instanceof FileHostObject) {
                fileHostObject = (FileHostObject) arguments[0];
                outputStreamWriter = new OutputStreamWriter(
                        fileHostObject.getOutputStream());
                feedObject.feed.writeTo(outputStreamWriter);
                outputStreamWriter.flush();
            } else {
                throw new ScriptException("Invalid parameter");
            }
View Full Code Here

TOP

Related Classes of org.jaggeryjs.hostobjects.file.FileHostObject

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.