Search code examples
java-mewritefile

How to access files in Java ME


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);


Solution

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