Today I have realized :-) that I can use java from javascript in chrome
environment and in this case there is no security restriction. So, my question
is:  what is the trade-off using java instead of xpcom for certain type of
operation?
I have never read any article or tutorial promoting the use of some java classes
from javascript in chrome environment. Why? There is something wrong in this
approach?
Thanks in advance.
Eg:

function readFile() {
    var fname = "D:/tmp/test.txt";
    try {
        var fin = new java.io.FileInputStream(fname);
        var ins = new java.io.DataInputStream(fin);
        var fcontent = "";
        while(ins.available() !=0) {
            console.debug(ins.readLine()) //firebug console
        }

    }catch(ex) {
        console.debug(ex);
    }finally {
      ins.close();
    }
}
_______________________________________________
dev-tech-xpcom mailing list
[email protected]
https://lists.mozilla.org/listinfo/dev-tech-xpcom

Reply via email to