Java Security FAQ: Delete a File Using /usr/bin/rm


Here's an applet that tries to delete a file by invoking the unix command /usr/bin/rm /tmp/foo:

Here's the source.

Conclusion:

Applets can't delete files if they're loaded into Netscape Navigator 2.0, and applets loaded over the net can't delete files if they're loaded into the appletviewer. Applets loaded on your local file system in a directory on your CLASSPATH can delete files on your local disk.


Back to the Java Security FAQ