@Test public void setOwnerBits() { Mode mode = new Mode((short) 0000); mode.setOwnerBits(Mode.Bits.READ_EXECUTE); assertEquals(Mode.Bits.READ_EXECUTE, mode.getOwnerBits()); mode.setOwnerBits(Mode.Bits.WRITE); assertEquals(Mode.Bits.WRITE, mode.getOwnerBits()); mode.setOwnerBits(Mode.Bits.ALL); assertEquals(Mode.Bits.ALL, mode.getOwnerBits()); }
case OWNING_USER: Mode modeOwner = new Mode(mMode); modeOwner.setOwnerBits(Mode.Bits.NONE); if (mAccessAcl != null) { modeOwner.setOwnerBits(new Mode(mAccessAcl.mMode).getOwnerBits());
/** * Applies the given umask {@link Mode} to this mode. * * @param mode the mode to update * @param umask the umask to apply * @return the updated object */ private static Mode applyUMask(Mode mode, Mode umask) { mode.setOwnerBits(mode.getOwnerBits().and(umask.getOwnerBits().not())); mode.setGroupBits(mode.getGroupBits().and(umask.getGroupBits().not())); mode.setOtherBits(mode.getOtherBits().and(umask.getOtherBits().not())); return mode; }
case OWNING_USER: Mode modeOwner = new Mode(mMode); modeOwner.setOwnerBits(entry.getActions().toModeBits()); mMode = modeOwner.toShort(); return;
updateMode.setOwnerBits(updateMode.getOwnerBits().and(defaultMode.getOwnerBits())); updateMode.setOtherBits(updateMode.getOtherBits().and(defaultMode.getOtherBits())); acl.mMode = updateMode.toShort();