• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

File writing in Mobile device

 
aaj
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I am unable to write a file using my MIDP application in Nokia 9500. I am using 9500 emulator to test my application. I am getting the

java.lang.SecurityException: Access denied
- com.symbian.midp.io.protocol.file.FileConnectionImpl.open(), bci=127
- com.symbian.midp.io.protocol.file.Protocol.openConnection(), bci=40
- com.symbian.gcf.ProtocolBase.openConnection(), bci=142
- com.symbian.gcf.GCFConnector.open(), bci=198
- javax.microedition.io.Connector.open(), bci=4
- javax.microedition.io.Connector.open(), bci=3
- CryptoTest$AskForKey.writeUnicodeFile(), bci=17
- CryptoTest$AskForKey$FileWriteThread.run(), bci=8

Can anyone please suggest some solution?

I am using JSR75 to write the file. Here is the code block

String url = "file:///C:/test1.jar";

FileConnection conn = ( FileConnection )Connector.open(url,Connector.WRITE);
conn.create();

OutputStreamWriter out = new OutputStreamWriter( conn.openOutputStream() );
out.write( "test",0,4 );
out.close();
 
Mark Spritzler
ranger
Sheriff
Posts: 17278
6
IntelliJ IDE Mac Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
"aaj"

Please click on the "My Profile" link above and change your display name to match the JavaRanch Naming Policy of using your real first and last names.

Thanks

Mark
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic