Acls { @SuppressWarnings("PointlessBitwiseExpression") public static int toMode(nfsace4[] acl) { return calculateBits(OWNER, acl) << BIT_MASK_OWNER_OFFSET | calculateBits(GROUP, acl) << BIT_MASK_GROUP_OFFSET | calculateBits(EVERYONE, acl) << BIT_MASK_OTHER_OFFSET; } private  Acls(); static nfsace4[] addACE(nfsace4 ace, nfsace4[] acl); static nfsace4[] addACE(nfsace4[] acl, nfsace4 ace); static nfsace4[] of(int mode, boolean isDir); static int toAccessMask(int mode, boolean isDir, boolean isOwner); @SuppressWarnings("PointlessBitwiseExpression") static int toMode(nfsace4[] acl); static nfsace4[] adjust(nfsace4[] acl, int mode); static nfsace4[] compact(nfsace4[] acl); static boolean wantModify(int accessMask); static final int RBIT; static final int WBIT; static final int XBIT; final static utf8str_mixed OWNER; final static utf8str_mixed GROUP; final static utf8str_mixed EVERYONE; }
@Test public void testAllRead() { int rwx = 0444; nfsace4[] acl = new nfsace4[]{ toACE(Acls.EVERYONE, ACE4_ACCESS_ALLOWED_ACE_TYPE, ACE4_READ_DATA) }; assertEquals(rwx, toMode(acl)); }