title: Files.exists(path) and path.toFile().exists() give different results for the same file
body: <p>I'm getting a different result for <code>Files.exists(path)</code> to <code>path.toFile().exists()</code> for a local file on Windows. I can see this file in Windows Explorer although I have (randomly) modified permissions and perhaps the permissions do not make sense.</p>
  
  <p>However this doesn't explain why the old method returns true and the new methods returns false. The file definently exists but maybe it is invisible to the user running the Java code, so I'm not sure what the correct answer should be. Nor can I see how to see which user is running the code, there is only one real user <strong>Paul</strong> on the computer, but I'm wondering if whether if run as administrator or not effects things.</p>
  
  <pre><code>System.out.println("Path Exists(1):"+Files.exists(path));
  System.out.println("Path Exist(2) :"+path.toFile().exists());
  </code></pre>
  
  <p>gives</p>
  
  <pre><code>Path Exists(1):false
  Path Exist(2) :true
  </code></pre>
  
  <p>Also</p>
  
  <pre><code>System.out.println("Path readable(3) :"+Files.isReadable(path));
  System.out.println("Path readable(4):"+path.toFile().canRead());
  </code></pre>
  
  <p>works in same way giving</p>
  
  <pre><code>Path readable(3) :false
  Path readable(4):true
  </code></pre>
  
  <p>Permissions output</p>
  
  <pre><code>File C:\Code\jthink\opensrc\jaudiotagger\testdata\test157.dsf permissions
  owner:PCLAPTOP\Paul
  NT AUTHORITY\SYSTEM:READ_DATA/WRITE_DATA/APPEND_DATA/READ_NAMED_ATTRS/WRITE_NAMED_ATTRS/EXECUTE/DELETE_CHILD/READ_ATTRIBUTES/WRITE_ATTRIBUTES/DELETE/READ_ACL/WRITE_ACL/WRITE_OWNER/SYNCHRONIZE:DENY
  BUILTIN\Administrators:READ_DATA/WRITE_DATA/APPEND_DATA/READ_NAMED_ATTRS/WRITE_NAMED_ATTRS/EXECUTE/DELETE_CHILD/READ_ATTRIBUTES/WRITE_ATTRIBUTES/DELETE/READ_ACL/WRITE_ACL/WRITE_OWNER/SYNCHRONIZE:DENY
  BUILTIN\Administrators:READ_DATA/WRITE_DATA/APPEND_DATA/READ_NAMED_ATTRS/WRITE_NAMED_ATTRS/EXECUTE/DELETE_CHILD/READ_ATTRIBUTES/WRITE_ATTRIBUTES/DELETE/READ_ACL/WRITE_ACL/WRITE_OWNER/SYNCHRONIZE:ALLOW
  NT AUTHORITY\SYSTEM:READ_DATA/WRITE_DATA/APPEND_DATA/READ_NAMED_ATTRS/WRITE_NAMED_ATTRS/EXECUTE/DELETE_CHILD/READ_ATTRIBUTES/WRITE_ATTRIBUTES/DELETE/READ_ACL/WRITE_ACL/WRITE_OWNER/SYNCHRONIZE:ALLOW
  BUILTIN\Users:READ_DATA/READ_NAMED_ATTRS/EXECUTE/READ_ATTRIBUTES/READ_ACL/SYNCHRONIZE:ALLOW
  NT AUTHORITY\Authenticated Users:READ_DATA/WRITE_DATA/APPEND_DATA/READ_NAMED_ATTRS/WRITE_NAMED_ATTRS/EXECUTE/READ_ATTRIBUTES/WRITE_ATTRIBUTES/DELETE/READ_ACL/SYNCHRONIZE:ALLOW
  
  
  c:\Code\jthink\opensrc\jaudiotagger&gt;attrib C:\Code\jthink\opensrc\jaudiotagger\testdata\test157.dsf
  A    R       C:\Code\jthink\opensrc\jaudiotagger\testdata\test157.dsf
  </code></pre>
  
  <p><strong>Update</strong>
  I dont have a conclusion but thought this information could be useful.</p>
  
  <p>I was running code in IntelliJ IDE without the IDE <strong><em>Run program as Administrator</em></strong> option enabled, enabling this did then cause the Java application to also get the administrator privileges.</p>
  
  <p>Interesting for another file I didn't add any DENY privileges, I just disabled inherit permissions and remove READ permissions from all groups. Then when I ran as user without run as admin enabled it could not read the file and also this code could not any output any information </p>
  
  <pre><code>AclFileAttributeView view = Files.getFileAttributeView(path, AclFileAttributeView.class);
  if (view != null)
  {
      sb.append("Owner:"+view.getOwner().getName()+"**");
      for (AclEntry acl : view.getAcl())
      {
          sb.append(acl.principal()+"**");
          for(AclEntryPermission aep:acl.permissions())
          {
              sb.append(aep.toString() + "**");
          }
      }
  }
  </code></pre>
  
  <p>but when I run with <strong><em>Run program as adminstrator</em></strong> enabled it still couldnt read the file, but the above code did now output some of the permissions as follows:</p>
  
  <blockquote>
    <p>Owner:BUILTIN\Administrators </p>
    
    <p>NT AUTHORITY\SYSTEM:WRITE_DATA/APPEND_DATA/WRITE_NAMED_ATTRS/WRITE_ATTRIBUTES/SYNCHRONIZE:ALLOW 
    PCLAPTOP\Paul:WRITE_DATA/APPEND_DATA/WRITE_NAMED_ATTRS/WRITE_ATTRIBUTES/SYNCHRONIZE:ALLOW 
    BUILTIN\Administrators:WRITE_DATA/APPEND_DATA/WRITE_NAMED_ATTRS/WRITE_ATTRIBUTES/SYNCHRONIZE:ALLOW </p>
  </blockquote>
  
  <p>as you can see even though <code>Administrators</code> do not have <code>READ</code> or <code>READ PERMISSIONS</code> options they can output the permissions whereas before they couldn't, perhaps due to BUILTIN/Administraor being returned as owner.</p>