title: In Java what exactly does File.canExecute() do?
body: <p>I have created a plain file which does not have execute permission but when I create a Java File object using this file's path/name and then call File.canExecute() I get true as the result, whereas I would expect this method call to return false.  Can someone explain what I'm missing here?</p>
  
  <p>Solaris:</p>
  
  <pre><code>$ touch /tmp/nonexecutable
  $ ls -l /tmp/nonexecutable
  -rw-r--r--   1 root     root           0 May 21 07:48 /tmp/nonexecutable
  </code></pre>
  
  <p>Java:</p>
  
  <pre><code>String pathName = "/tmp/nonexecutable";
  File myFile = new File(pathName);
  if (!myFile.canExecute())
  {
      String errorMessage = "The file is not executable.";
      log.error(errorMessage);
      throw new RuntimeException(errorMessage);
  }
  </code></pre>
  
  <p>Thanks in advance for your help.</p>
  
  <p>--James</p>