title: File works in Java 1.5 but not in Java 7 (java.io.FileNotFoundException Permission Denied)
body: <p>I have a file that I'm trying to access. When I accessed it in Java 1.5 it was fine. I have since upgraded to Java 7 and now I am getting a java.io.FileNotFoundException Permission Denied error. </p>
  
  <pre><code>java.io.FileNotFoundException: /folder/test.xml (Permission denied)
  at java.io.FileOutputStream.open(Native Method)
  at java.io.FileOutputStream.&lt;init&gt;(FileOutputStream.java:212)
  at java.io.FileOutputStream.&lt;init&gt;(FileOutputStream.java:104)
  at SerializeUtil.write(Unknown Source)
  </code></pre>
  
  <p>It is actually trying to write to the file using an XMLEncoder</p>
  
  <pre><code>XMLEncoder encoder = new XMLEncoder(new BufferedOutputStream(new FileOutputStream(filename)));
  encoder.writeObject(object);
  encoder.close();
  </code></pre>