title: FileNotFoundException on FileOutputStream in spite of mkdirs() and createNewFile()
body: <p>I have a bean that download emails from SMTP server. After read emails it saves attachments on the server. To read attachment I use this code:</p>
  
  <pre><code>File f = new File("\\attachments\\" + attachment.getFileName());
  f.mkdirs();
  f.createNewFile();
  FileOutputStream fos = new FileOutputStream(f);
  fos.write(bytes);
  fos.close();
  </code></pre>
  
  <p>I got a FileNotFoundException on FileOutputStream creating and I can't understand why.
  If can help, I use NetBeans with GlassFish and the tests are made in debug in local machine.</p>