Root is not accessible in j2me exception

93 Views Asked by At
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();
}
1

There are 1 best solutions below

0
On

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