|
Help | Solution | API Docs | Expected Output
Skeleton Code
This magercise takes you through the steps necessary to allow an applet to write to a local file. Using See the A Quick Look at policytool course section for additional information. Perform the following tasks:
Compile the
PLTester.java program. It contains a
Save the
PLTester.html loader and try the program without using Select Add Policy Entry and enter "file:." in the CodeBase field. This means you are updating the security policy for classes loaded from the current directory. Next select Add Permission to bring up the Add New Permissions screen. For a permission, select FilePermission in the first option. For a target, enter the filename you wish to make writable. For the actions option, either select write or enter write in the field to its right. Then select OK to close this window.
On the Policy Entry window, select Done. At this point, rerun the test applet and see if the file is writable. Try different values for the filename to ensure ONLY that file is writable and nothing else.
After testing the applet, be sure to remove the entry from the policy file with The task numbers above are linked to the step-by-step help page. Also available is a complete solution to the problem, and a demonstration of the expected behavior. Copyright © 1998 MageLang Institute. All Rights Reserved. | ||||
|
| ||||||||||||