• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

java file.CanExecute always returns true on an AIX machine

 
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Ranch Hand
Posts: 75
Tomcat Server Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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?


reply
    Bookmark Topic Watch Topic
  • New Topic