/** * With Netscape Navigator 2.0, an applet can't use /bin/rm to delete * a file. * * With appletviewer, applets loaded over the net can't use /bin/rm * to delete a file. If an applet is installed on your local * file system in a directory on CLASSPATH, then it can use /bin/rm * to delete a file. * * @version JDK 1.0 beta * @author Marianne Mueller */ import java.awt.*; import java.io.*; import java.lang.*; import java.applet.*; public class rm extends Applet { public void paint(Graphics g) { try { Runtime.getRuntime().exec("/usr/bin/rm /tmp/foo"); g.drawString("Success exec'ing /usr/bin/rm on /tmp/foo", 10, 10); } catch (SecurityException e) { g.drawString("Caught security exception trying /usr/bin/rm /tmp/foo", 10, 10); } catch (IOException ioe) { g.drawString("Caught i/o exception trying /usr/bin/rm /tmp/foo", 10, 10); } } }