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 "" {
  permission java.io.FilePermission "writetest", "write";

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