On Sunday 11 June 2006 00:58, lordsh wrote:
> I'm new with java and aglets, and i hope that you can help me.
Welcome! :)
> If i want to modified the Security Preference of tahiti to include the
> use of file ".class" in the directory c:\XXX\XXX what i do?
I hope I have understood your problem correctly.
The graphical way would be from Tahiti's menu to go to Options -> Security
Preference. In the resulting dialog, type file:/C:/XXX/XXX/ with forward
slashes, as it is a URL. Then click the "Add" button under "Code Base".
Select the freshly added URL and then from the right side add permissions.
First you select a permission type from the drop down list at the top, then
you edit the parameters of the permission in the fields at the bottom, then
you click on the "Add" button from the right half of the dialog to add the
permission to the list. You will see the freshly added permission in the list
under the "Add" button.
I find the interface not too friendly towards beginners. It assumes you
already know how Java's policy system works and what parameters to use in
order to instruct the Permission classes to enforce the behaviour you want.
There are few clues in the interface about what the Aglets specific
permissions mean and I found little documentation about it.
Another way to go about it is to edit the policy file by hand. It is located
at ${user.home}/.aglets/security/aglets.policy . The Aglets policy system
exists since Aglets was compatible with JDK 1.1.3, so it did not use the
Java2 policy system, but imitated it. For this reason the Aglets policy
system is not a pure Java2 policy system and you may find small discrepancies
between the Java documentation and the way Aglets policies work. However, you
can mostly use Java documentation and test your application whenever you
apply it to Aglets. The syntax of Java policy files is documented at
http://java.sun.com/j2se/1.5.0/docs/guide/security/PolicyFiles.html . You can
try older versions of that document, which are closer to Aglets. You can also
use the sample Aglets policy file that you can find at
${user.home}/.aglets/security/sample.policy .
Find out what the Java-specific permissions mean at:
http://java.sun.com/j2se/1.5.0/docs/guide/security/permissions.html
For the Aglets-specific policy objects, since the source code is available you
can find out from it what parameters they use and what they do. They are
classes whose names usually end in Permission or Protection. Good luck with
this!
Sun's 'policytool' tool has a GUI that may help you generate policy files,
although Aglets policy syntax is slightly older than that of the newest Sun
JDKs.
Hope this helps,
Thomas.
--
[Random fortune cookie]:
You'll feel much better once you've given up hope.
Disclaimer: http://www.kuleuven.be/cwis/email_disclaimer.htm
|