/** * With Netscape Navigator 2.0 and with appletviewer, this always * raises security exception, regardless of the setting of acl.write * and regardless of whether the applet was loaded over the net or * via the file system. * * @version JDK 1.0 beta * @author Marianne Mueller */ import java.awt.*; import java.io.*; import java.applet.*; public class deleteFile extends Applet { File myFile = new File("/tmp/foo"); public void paint(Graphics g) { try { myFile.delete(); g.drawString("Successfully deleted " + myFile.toString(), 10, 10); } catch (SecurityException e) { g.drawString("Caught security exception trying to delete file " + myFile.toString(), 10, 10); } } }