问题
I have a need to manage UNIX ACL (Access Control List) on files in a file system, and it includes query & modification of ACE (Access Control Entry) on different types of UNIX systems like Linux, SUN etc. with POSIX, NFS style file systems.
My first thought was to create a wrapper or an interface on top of the file system services to handle these ACL needs.
Is anybody aware of any such Java API that can be used for the purpose?
回答1:
Is anybody aware of any such Java API that can be used for the purpose?
Yes there is one. It is java.nio.file.attribute.AclFileAttributeView which is part of the NIO enhancements added in Java 7.
There is a simple example in the javadoc for the above class.
(The java.security
ACL stuff is for access control implemented by / within Java security. That is orthogonal to ACL support at the file-system level.)
来源:https://stackoverflow.com/questions/21360619/is-there-a-java-interface-for-managing-unix-acl