Use SecurityManager!
- Paste the current unix user id into ThreadLocal
- Create your own SecurityManager that checks unix user rights on checkRead () and checkWrite ()
- System.setSecurityManager (new MySecurityManager ())
- Enjoy
Update
Of course, there is no standard library for reading unix file permissions. This is not WORA.
:
http://jan.newmarch.name/java/posix/ JNI, JNI, .:) , .
Stat :
http://jan.newmarch.name/java/posix/posix.Stat.html
2
, "" unix, ACL Posix Capabilities ( , , ). , SecurityManager, JVM! , SUID-, ( , , ), , SecurityManager!