更新时间:2023-01-25 17:29:20
有人知道任何可用于此目的的Java API吗?
是的。它是 java .nio.file.attribute.AclFileAttributeView
是Java 7中NIO增强功能的一部分。
有一个简单的
( java.security
ACL内容用于由/在Java安全性范围内。与文件系统级别的ACL支持正交。)
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?
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.)