In my Java Applet, there is a method titled SaveToFile(String text):
public Boolean SaveToFile(String text)
{
File file = new File("c:\\myFile.txt");
if (!file.exists()) {
file.createNewFile();
}
file.setReadable(true);
file.setWritable(true);
FileWriter fw = new FileWriter(file.getAbsoluteFile());
BufferedWriter bw = new BufferedWriter(fw);
bw.write(text);
bw.close();
return true;
}
When I trigger this method from a button within the applet, it successfully creates the file. However, when calling this method from JavaScript, an exception occurs:
access denied (java.io.FilePermission c:\myFile.txt read)
What steps can be taken to resolve this exception?