We\'re developing an applet and need it to be able to read/write files in the user\'s temporary files directory (e.g. C:\\Documents and Settings\\USERNAME\\Local Settings\\T
Using the policy file is kinda ok for testing but you should not be relying on it for your finished code, especially when granting a file permission, it is dangerous.
To interact with files you need to do the following.
Sign your jar - tons of tutorials like this, you can just do a self signed one.
Add the file creation code to a privileged block here is an example
File myFile = (File) AccessController.doPrivileged(new PrivilegedAction() {
public Object run()
{
return new File("C:\\MyFolder\\MyFile");
}
});