Java Security Example: Writing Files


Here's an applet that tries to write to the file named "writetest".

If you don't see the applet, download and install the JDK or JRE.

Here's the source.

This applet won't work unless you've configured your policy to allow it to write such a file; if not, you will see an AccessControlException. If you've configured your system to allow applets from this applets' location to write the specified file, check your current directory! You'll find a file there named "writetest".