title: Java FileOutputStream access denied to a signed applet
body: <p>I'm developping a Java Applet that must access the visitor's filesystem, so i compressed my <code>.class</code> file to a <code>.jar</code> file with self-signed cert, when I'm opening the <code>call.html</code> file with my browser (file where is located the <code>&lt;applet&gt;</code> HTML tag), I accept the security popup then i'm getting this error in the Java console:</p>
  
  <blockquote>
    <p>java.security.AccessControlException: access denied (java.io.FilePermission output.txt write)</p>
  </blockquote>
  
  <p>I'm using a <code>FileInputStream</code> and a <code>FileOutputStream</code>. <code>FileInputStream</code> works but not  <code>FileOutputStream</code>, why?</p>
  
  <p>Here's my code:</p>
  
  <pre class="lang-java prettyprint-override"><code>try {
        AccessController.doPrivileged(
            new PrivilegedExceptionAction() {              
                @Override 
                public Object run() throws FileNotFoundException {
                    outFile = new FileOutputStream("output.txt");
                    inFile = new FileInputStream("input.txt");
                    return "test";
                }
            }
        );
  } catch (PrivilegedActionException e) {
      throw (FileNotFoundException) e.getException();
  }
  </code></pre>
  
  <p>I've tried many way to make privileged actions, <code>FileInputStream</code> is always working, whereas <code>FileOutputStream</code> isn't. <code>output.txt</code> is not read-only file.</p>