Click to See Complete Forum and Search --> : File I/O - How?


Jason Teagle
March 8th, 1999, 02:30 AM
I would like to be able to create and maintain a small text file on the server from which the applet runs, i.e. local to the applet. The file would contain information I want to keep persistent, such as a counter's current count, for example. The problem is, when I try to create the DataInputStream or DataOutputStream I get a security exception thrown.


How am I supposed to maintain persistent data if I can't use a file? It's not like I'm trying to store it on the user's PC, I'm trying to store it on the applet's server! What am I missing? Or is there a better way to do what I want?


Thanks in advance.

SINGH
March 8th, 1999, 04:08 AM
Hi,

The problem is there because the browser default SecurityManager do not allow the applet to be able to access the file on the local machine.

In order to achieve that,you've to override it's SecurityManager.but I'm still thinking how? It is b'cuz it is not allowed to set a security manager when a security manager is already existing..

Singh

Jason Teagle
March 8th, 1999, 05:36 AM
This makes sense, as I read up a little on the Security Manager and found that particular problem. If anyone has any further ideas, please let me know.