using java policy files

hello frnds,could you please explain little bit why java policy files are usedand is every application required policy files? if not than which one...
[171 byte] By [johnray31a] at [2007-10-2 10:34:50]
# 1
anybody plz explain to me
johnray31a at 2007-7-13 2:35:09 > top of Java-index,Java Essentials,Java Programming...
# 2

Sometime you run a java program with a SecurityManager installed, sometimes not. If there is one, then you usually need a .policy file. The policy file constrains what different parts of the java program are allowed to do, e.g. it may or may not be allowed to read or to write files on the file system, open a socket to particular machines and ports, access system properties and so on.

The way it works is that you grant a list of priviledges to certain "code sources", normally specified jar files and class directories. You can also specify digital signatures for grants. The policy file consists of grant blocks.

It's a fairly complicated system, because if less privileged code calls more privileged code then the lowest priviledges normally apply, unless the more priviliged code determines otherwise.

malcolmmca at 2007-7-13 2:35:09 > top of Java-index,Java Essentials,Java Programming...
# 3
hi frndsThankx for ur valuable answer,could you please tell me how we create policy files, or from where i could find material on creating policy files so that i can see example of it.
johnray31a at 2007-7-13 2:35:09 > top of Java-index,Java Essentials,Java Programming...
# 4
> could you please tell me how we create policy filesThere's documentation and examples here (for windows): http://java.sun.com/j2se/1.5.0/docs/tooldocs/windows/policytool.html
pbrockway2a at 2007-7-13 2:35:09 > top of Java-index,Java Essentials,Java Programming...