@Test public void testSymbol() { Permission p1 = new Permission(777); assertEquals("rwxrwxrwx", p1.getSymbol()); Permission p2 = new Permission(666); assertEquals("rw-rw-rw-", p2.getSymbol()); }
public String getSymbol() { final StringBuilder symbolic = new StringBuilder(); symbolic.append(setuid ? user.implies(Action.execute) ? StringUtils.substring(user.symbolic, 0, 2) + "s" : StringUtils.substring(user.symbolic, 0, 2) + "S" : user.symbolic); symbolic.append(setgid ? group.implies(Action.execute) ? StringUtils.substring(group.symbolic, 0, 2) + "s" : StringUtils.substring(group.symbolic, 0, 2) + "S" : group.symbolic); symbolic.append(sticky ? other.implies(Action.execute) ? StringUtils.substring(other.symbolic, 0, 2) + "t" : StringUtils.substring(other.symbolic, 0, 2) + "T" : other.symbolic); return symbolic.toString(); }
Permission implements Serializable { public String getSymbol() { final StringBuilder symbolic = new StringBuilder(); symbolic.append(setuid ? user.implies(Action.execute) ? StringUtils.substring(user.symbolic, 0, 2) + "s" : StringUtils.substring(user.symbolic, 0, 2) + "S" : user.symbolic); symbolic.append(setgid ? group.implies(Action.execute) ? StringUtils.substring(group.symbolic, 0, 2) + "s" : StringUtils.substring(group.symbolic, 0, 2) + "S" : group.symbolic); symbolic.append(sticky ? other.implies(Action.execute) ? StringUtils.substring(other.symbolic, 0, 2) + "t" : StringUtils.substring(other.symbolic, 0, 2) + "T" : other.symbolic); return symbolic.toString(); } }
Permission implements Serializable { public String getSymbol() { final StringBuilder symbolic = new StringBuilder(); symbolic.append(setuid ? user.implies(Action.execute) ? StringUtils.substring(user.symbolic, 0, 2) + "s" : StringUtils.substring(user.symbolic, 0, 2) + "S" : user.symbolic); symbolic.append(setgid ? group.implies(Action.execute) ? StringUtils.substring(group.symbolic, 0, 2) + "s" : StringUtils.substring(group.symbolic, 0, 2) + "S" : group.symbolic); symbolic.append(sticky ? other.implies(Action.execute) ? StringUtils.substring(other.symbolic, 0, 2) + "t" : StringUtils.substring(other.symbolic, 0, 2) + "T" : other.symbolic); return symbolic.toString(); } Permission();  Permission(final String mode);  Permission(final Action u, final Action g, final Action o);  Permission(final Action u, final Action g, final Action o,
                      final boolean stickybit, final boolean setuid, final boolean setgid);  Permission(final int mode);  Permission(final Permission other); }
Permission implements Serializable { public String getSymbol() { final StringBuilder symbolic = new StringBuilder(); symbolic.append(setuid ? user.implies(Action.execute) ? StringUtils.substring(user.symbolic, 0, 2) + "s" : StringUtils.substring(user.symbolic, 0, 2) + "S" : user.symbolic); symbolic.append(setgid ? group.implies(Action.execute) ? StringUtils.substring(group.symbolic, 0, 2) + "s" : StringUtils.substring(group.symbolic, 0, 2) + "S" : group.symbolic); symbolic.append(sticky ? other.implies(Action.execute) ? StringUtils.substring(other.symbolic, 0, 2) + "t" : StringUtils.substring(other.symbolic, 0, 2) + "T" : other.symbolic); return symbolic.toString(); } Permission();  Permission(final String mode);  Permission(final Action u, final Action g, final Action o);  Permission(final Action u, final Action g, final Action o,
                      final boolean stickybit, final boolean setuid, final boolean setgid);  Permission(final int mode);  Permission(final Permission other); @Override T serialize(final Serializer dict); Action getUser(); void setUser(final Action user); Action getGroup(); void setGroup(final Action group); Action getOther(); void setOther(final Action other); boolean isSetuid(); void setSetuid(final boolean setuid); boolean isSetgid(); void setSetgid(final boolean setgid); boolean isSticky(); void setSticky(final boolean sticky); String getSymbol(); String getMode(); @Override String toString(); boolean isExecutable(); boolean isReadable(); boolean isWritable(); @Override boolean equals(final Object o); int hashCode(); }
Permission implements Serializable { public String getSymbol() { final StringBuilder symbolic = new StringBuilder(); symbolic.append(setuid ? user.implies(Action.execute) ? StringUtils.substring(user.symbolic, 0, 2) + "s" : StringUtils.substring(user.symbolic, 0, 2) + "S" : user.symbolic); symbolic.append(setgid ? group.implies(Action.execute) ? StringUtils.substring(group.symbolic, 0, 2) + "s" : StringUtils.substring(group.symbolic, 0, 2) + "S" : group.symbolic); symbolic.append(sticky ? other.implies(Action.execute) ? StringUtils.substring(other.symbolic, 0, 2) + "t" : StringUtils.substring(other.symbolic, 0, 2) + "T" : other.symbolic); return symbolic.toString(); } Permission();  Permission(final String mode);  Permission(final Action u, final Action g, final Action o);  Permission(final Action u, final Action g, final Action o,
                      final boolean stickybit, final boolean setuid, final boolean setgid);  Permission(final int mode);  Permission(final Permission other); @Override T serialize(final Serializer dict); Action getUser(); void setUser(final Action user); Action getGroup(); void setGroup(final Action group); Action getOther(); void setOther(final Action other); boolean isSetuid(); void setSetuid(final boolean setuid); boolean isSetgid(); void setSetgid(final boolean setgid); boolean isSticky(); void setSticky(final boolean sticky); String getSymbol(); String getMode(); @Override String toString(); boolean isExecutable(); boolean isReadable(); boolean isWritable(); @Override boolean equals(final Object o); int hashCode(); static final Permission EMPTY; }