title: file.exists() and file.createNewFile() not working properly?
body: <p>Basicly, lets say I got <code>File f1 = new File("C:\\somedir\\batch1.bat");</code> and <code>File f2 = new File("C:\\somedir\\batch2.bat");</code> and I have 2 ifs</p>
  
  <pre><code>if(f1.exists() == false)
  {
      showMessage("File 1 not detected, creating new...");
      f1.createNewFile();
  }
  else
  {
      showMessage("File 1 detected, deleting it and creating new...");
      f1.delete();
      f1.createNewFile();
  }
  </code></pre>
  
  <p>and</p>
  
  <pre><code>if(f2.exists() == false)
  {
      showMessage("File 2 not detected, creating new...");
      f2.createNewFile();
  }
  else
  {
      showMessage("File 2 detected, deleting it and creating new...");
      f2.delete();
      f2.createNewFile();
  }
  </code></pre>
  
  <p>First if executes "else" code no matter if file exists or not, and second one executes "if" part, without creating new file. help please!</p>
  
  <h3>EDIT</h3>
  
  <p>My <code>showMessage(String msg)</code> method does <code>System.out.println(msg)</code> just so you know.</p>