Hi,
I have a problem when try to read a file in the cell phone. I just put in my MIDLet the API permissions (javax.microedition.io.Connector.file.read, javax.microedition.io.Connector.file.write) but when I try to write the file i have an error.
the code is the following:
String path="file:///C:/Gallery/Test.txt";
FileConnection fc=(FileConnection)Connector.open(path,Connector.WRITE);
if(!fc.exists()){
fc.create();
}
DataOutputStream dos = fc.openDataOutputStream();
String s = "data";
dos.write(s.getBytes(),0,s.length());
dos.close();
fc.close();
} catch (Exception e) {
e.printStackTrace();
}
when i run the code i get a question : "You want allow that the application read data in: Gallery . This application isn't by secure provider".....ok, that's allright! But when I say "yes" get java.lang.SecurityException: Access denied!!!!!!!!!!!!!
Someone can help me?
Thank you.

Reply With Quote

