views:

25

answers:

2

I want to access the files encircled in this screenshot. What path should I use?

This is for my JavaME application. file:///ParseExample/service1.xml doesn't seem to be the right one.

http://www.fileden.com/files/2010/5/28/2872707//projectfiles.JPG

Edit: Here is my code: FileConnection fconn = (FileConnection) Connector.open("file:///ParseExample/service1.xml", Connector.READ_WRITE);

A: 

If these are files that you are going to be bundling in your MIDlet JAR then you need to use Class.getResourceAsStream().

funkybro
A: 

have you tried new File("ParseExample/service1.xml");?

This access the file with a relative path instead of a absolute path, as in your example. (You could also try "file://ParseExample/service1.xml"(only two slashes after the colon).

And, as funkybro said, if you are packing it in a jar, you need Class.getResourceAsStream()...

Peter