11-21-2012 05:30 AM
InputStream in = classs.getResourceAsStream("file.js");
But i get "could not find this path" and I use also an other code
String srcFile = "/res/ressourcesWeb/file.js"; FileConnection srcConn = (FileConnection) Connector.open(srcFile, Connector.READ); InputStream in = srcConn.openInputStream();
but i got an exception. Can any one help me to read the file and give me the right path that should I use?
Solved! Go to Solution.
11-21-2012 05:49 AM
i have the file in res folder. I didn't get what should I write in (*******) . If I should write the current class where I write this code. How it will find the file from res? the package is in folder "src" and my file in folder "res"???
Class classs = Class.forName("************************");
11-21-2012 05:56 AM
Actually the class you define is almost irrelevant. You are just finding a class Object that belongs to the Application that has the res folder you are trying to read.
So you can just do something like this:
Class classs = Application.getApplication().getClass();
is = classs.getResourceAsStream(.....);
11-28-2012 03:20 AM
I want to open Connector from file in filder res. I'm not able to get the right path
fconn_dir = (FileConnection) Connector.open(