How to implement getfacl()
in java (Linux) since getacl()
works only on Windows. When I try to use AclFileAttributeView
in Linux for nfsv4 mounted drive I get null pointer.
Asked
Active
Viewed 309 times
1

Heron
- 329
- 2
- 5
- 15

satish john
- 226
- 1
- 6
- 14
-
I think a good starting point would be to post your code, ideally in the form of an SSCCE (http://sscce.org/). – NPE Oct 29 '13 at 07:31
-
Path file = Paths.get("
"); AclFileAttributeView aclFileAttributeView = Files.getFileAttributeView(file, AclFileAttributeView.class); System.out.println(aclFileAttributeView.getAcl()); – satish john Oct 30 '13 at 07:44 -
@satishjohn This does not work on Linux, does it? Looking at the [source](https://github.com/frohoff/jdk8u-jdk/blob/da0da73ab82ed714dc5be94acd2f0d00fbdfe2e9/src/solaris/classes/sun/nio/fs/LinuxFileSystem.java#L66) of the Unix filesystem implementation, the list of provided views looks pretty static to me. – LuedDev Sep 17 '19 at 07:25
-
The `AclFileAttributeView` interface has been implemented on Windows and Solaris only, so this is going to be a hand-rolled implementation. – Anya Shenanigans Nov 14 '19 at 12:10