In the default Policy implementation, code trying to write files must be granted the specified permission by a "policy entry" (sometimes referred to as a "grant entry") in a policy configuration file. The Policy Tool can be used to create such an entry in such a file.

The Policy Tool is distributed with the plug-in java (i.e. C:\Program Files\Java\j2re1.4.0_03\bin\policytool.exe).

  1. To Launch the Policy Tool double-click the file from windows explorer.
  2. To open the policy configuration file of applets, use the Open command in the File menu. This will present you with an Open dialog, which you can use to navigate the directory structure. Select the file .java.policy in your user profile folder (i.e. C:\Documents and Settings\”your user login”\) or if it doesn’t exist the file java.policy in the directory lib\security of your java plug-in (i.e. C:\Program Files\Java\j2re1.4.0_03\lib\security), then select the Open button.
  3. To modify the policy entry, select the entry "Codebase <ALL>", then select the Modify Policy Entry button in the main "Policy Tool" window.
  4. Select the Modify Policy Entry button in the main "Policy Tool" window. This brings up the Policy dialog box.
  5. To add the first permission, select the Add Permission button. This brings up the "Permissions" dialog box. Do the following:
    1. Select "File Permission" from the "Permission:" drop-down list. The complete permission type name (java.io.FilePermission) now appears in the text box to the right of the drop-down list.
    1. Select "<<ALL FILES>> from the list labeled "Target Name:".
    1. Specify write access by selecting "write" from the "Actions:" drop-down list.

Now the "Permission" dialog box looks like the following:

  1. Select the OK button. The new permission appears in a line in the "Policy Entry" dialog.
  2. You are now done specifying this policy entry, so select the Done button in the "Policy Entry" dialog.
  3. To save the user policy file, select the Save As command from the File menu and save the new policy with name .java.policy in your user profile folder (i.e. C:\Documents and Settings\”your user login”\).