title: file.delete() returns false even though file.exists(), file.canRead(), file.canWrite(), file.canExecute() all return true
body: <p>I'm trying to delete a file, after writing something in it, with <code>FileOutputStream</code>. This is the code I use for writing:</p>
  
  <pre><code>private void writeContent(File file, String fileContent) {
      FileOutputStream to;
      try {
          to = new FileOutputStream(file);
          to.write(fileContent.getBytes());
          to.flush();
          to.close();
      } catch (FileNotFoundException e) {
          // TODO Auto-generated catch block
          e.printStackTrace();
      } catch (IOException e) {
          // TODO Auto-generated catch block
          e.printStackTrace();
      }
  }
  </code></pre>
  
  <p>As it is seen, I flush and close the stream, but when I try to delete, <code>file.delete()</code> returns false.</p>
  
  <p>I checked before deletion to see if the file exists, and: <code>file.exists()</code>, <code>file.canRead()</code>, <code>file.canWrite()</code>, <code>file.canExecute()</code> all return true. Just after calling these methods I try <code>file.delete()</code> and returns false.</p>
  
  <p>Is there anything I've done wrong?</p>