canExecute()
doesn't test for executability, it tests whether the current program (i.e. yours) is permitted to execute it. For example, if you changed the permissions of one of the files to 000 (no read, write, or execute by any user), canExecute()
would probably return false as the JVM would not have permission to execute (or read) the file.
If you want to check for executable files, you could probably create a method that parses files for their suffix and returns true when it finds .exe (or .app on OS X).