dcsimg

What is the policy file and how exactly does this work?

Devikant Birje

For example, a browser's JVM does not allow an applet to access the local machine resources because they run under the scrutiny of a security manager. But still permission to access the client's machine can be granted by an entry in a policy file. The policy file looks like this:

grant codeBase "http://192.168.1.15:8080/classes/" {
  permission java.io.FilePermission "writetest", "write";
};

this was genereated automatically by the policytool. For additional info please go through this tutorial from Sun.