3
FileConnection fc = (FileConnection)Connector.open("file:///C:/products.dat",Connector.READ_WRITE);
if(!fc.exists())
{
    fc.create();
    OutputStream os=fc.openOutputStream();
    byte[] b=response.toString().getBytes();
    os.write(b);
    os.flush();
    fc.close();
}
Cœur
  • 37,241
  • 25
  • 195
  • 267
Nancy Jain
  • 204
  • 1
  • 7

1 Answers1

2

It seems that path that you are providing is not a valid root. To check For a list of all the valid root values in a device, call the listRoots() method of FileSystemRegistry.

other reason may be for some reason FileSystemRegistry can not access that path(disk error or read protected).

Saurav
  • 248
  • 3
  • 13