• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

java file.CanExecute always returns true on an AIX machine

 
Mahita Ande
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I have an application which has to check execution permissions for using the scripts. I am using java file.CanExecute method for this. This methods returns correct boolean when I run the app on HP-UX pr Linux machine. However when I run it on AIX machine it always returns True. Please advise how this can be fixed to return the correct boolean on AIX machine too.

Thank you,
Mahita
 
K. Gil
Ranch Hand
Posts: 75
Java Linux Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
canExecute ()

"Tests whether or not this process is allowed to execute this file. Note that this is a best-effort result; the only way to be certain is to actually attempt the operation."

--

public boolean canExecute() {
1521 SecurityManager security = System.getSecurityManager();
1522 if (security != null) {
1523 security.checkExec(path);
1524 }
1525 return fs.checkAccess(this, FileSystem.ACCESS_EXECUTE);
1526 }
1527

Returns:
true if and only if the abstract pathname exists and the application is allowed to execute the file
Throws:
java.lang.SecurityException If a security manager exists and its java.lang.SecurityManager.checkExec(java.lang.String) method denies execute access to the file

-----

Any "java.lang.SecurityException"s on AIX?


 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic