10 Replies Latest reply: Mar 12, 2009 6:01 AM by PhHein RSS

    File Handling with J2ME

    843851
      The following Line always gives throws the Exception / Error


      OutputConnection connection = (OutputConnection)
      Connector.open("file://c:/myfile.txt;append=true", Connector.WRITE );

      Throws the Exception :
      java.lang.IllegalArgumentException: Root is not specified
           at com.sun.midp.io.j2me.file.Protocol.openPrim(+196)
           at javax.microedition.io.Connector.openPrim(+233)
           at javax.microedition.io.Connector.open(+15)
           at javax.microedition.io.Connector.open(+6)
           at fileconnection.commandAction(+34)
           at javax.microedition.lcdui.Display$DisplayAccessor.commandAction(+282)
           at javax.microedition.lcdui.Display$DisplayManagerImpl.commandAction(+10)
           at com.sun.midp.lcdui.DefaultEventHandler.commandEvent(+68)
           at com.sun.midp.lcdui.AutomatedEventHandler.commandEvent(+47)
           at com.sun.midp.lcdui.DefaultEventHandler$QueuedEventHandler.run(+250)
      ------------------------------------------------------------------------------

      All i want to do is.., to write a simple string into a file using j2me
      some one please help me... !!!