Class NativePosixAcls
java.lang.Object
com.norconex.crawler.fs.fetch.acl.NativePosixAcls
Reads the extended ACLs of local files on Linux and macOS, which Java
itself cannot read: Java's posix view gives only the mode bits.
The operating system's C library is called through JNA, which finds it
when first used; nothing is compiled for an operating system, and no
tool needs to be installed on the host.
- Linux: the
system.posix_acl_accessextended attribute (whatsetfaclwrites), read withgetxattr. A file without it has no extended ACL. - macOS: the file's ACL, read with
acl_get_fileandacl_to_text.
-
Method Summary
Modifier and TypeMethodDescriptionstatic booleanAdds a local file's extended ACL entries to its permissions.static StringWhy extended ACLs cannot be read on this system, ornullif they can.
-
Method Details
-
read
Adds a local file's extended ACL entries to its permissions.- Parameters:
path- the fileacl- its permissions, from its mode bits- Returns:
- whether the file has an extended ACL
- Throws:
IOException- if extended ACLs cannot be read here, or the operating system could not read this file's