title: Different behaviour for Path.toFile() and new File(pathString)
body: <p>I have mounted a network drive (samba server) in Windows.</p>
  
  <p>I have a file in that drive that I wanted to read in a Java program.</p>
  
  <p>Before I was trying to read the file using:</p>
  
  <pre><code>Paths.get(basePath, fileName).toFile()
  </code></pre>
  
  <p>But it was failing with error that file does not exists. The file was there and the path was good.</p>
  
  <p>Then I tried the following code which worked:</p>
  
  <pre><code>String path = Paths.get(basePath, fileName).toAbsolutePath().toString()
  File file = new File(path)
  </code></pre>
  
  <p>Is there any difference between both approaches? Does it require any security settings?</p>
  
  <p><strong>Update</strong></p>
  
  <p>So after I had used the second part (the one that worked), I went back to original (as it was) to verify debugging and this time it worked. I tried it with another file in same directory and it failed. It seems weird but I will check more.</p>