站内搜索: 请输入搜索关键词
当前页面: 在线文档首页 > Java Tutorial 5.0 英文版

Set up the Policy File to Grant the Required Permissions - Java Tutorial 5.0 英文版

The JavaTM Tutorial
Previous Page Lesson Contents Next Page Start of Tutorial > Start of Trail > Start of Lesson Search
Feedback Form

Trail: Security in Java 2 SDK 1.2
Lesson: Quick Tour of Controlling Applications

Set up the Policy File to Grant the Required Permissions

You will now use the Policy Tool to open the policy file named mypolicy created in the Quick Tour of Controlling Applets (in the Security in Java 2 SDK 1.2 trail) lesson. You will add a new policy entry granting permission for code from the directory where GetProps.class is stored to read the "user.home" and the "java.home" property values, as shown in the following figure.

The steps are as follows.

  1. Open the Policy File

  2. Grant the Required Permissions

  3. Save the Policy File


Note for UNIX Users:  The instructions illustrate creating the policy file for a Windows system. The steps are exactly the same if you are working on a UNIX system, with the following differences.
  • You retrieve the mypolicy file from the test directory in your home directory.

  • For the CodeBase URL in the step for granting the required permissions, you can substitute file:${user.home}/test/ for file:/C:/Test/. Alternatively you could directly specify your home directory rather than referring to the "user.home" property, as in file:/home/susanj/test/.


Previous Page Lesson Contents Next Page Start of Tutorial > Start of Trail > Start of Lesson Search
Feedback Form

Copyright 1995-2005 Sun Microsystems, Inc. All rights reserved.