/** * @return String[] account name split on "/" */ @NoDump @JsonIgnore public String[] getAccountSplit() { final String res = getAccount(); if (!res.contains("/")) { return new String[]{res}; } return res.split("/"); }
@Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("UnknownTimezoneInfo(owner="); sb.append(owner.getAccount()); sb.append(", tzid="); sb.append(tzid); sb.append(")"); return sb.toString(); } }
/** * @return String account name without any leading "/" */ @NoDump @JsonIgnore public String getAccountNoSlash() { String res = getAccount(); if (res.startsWith("/")) { res = res.substring(1); } if (res.endsWith("/")) { res = res.substring(0, res.length() - 1); } return res; }
@Override @NoDump public boolean getUnauthenticated() { if (getAccount() == null) { return true; } return unauthenticated; }
/** Return true if the account name is in the group members. * * @param account * @param group boolean true if we're testing for a group. * @return true if the account name is in the group members. */ public boolean isMember(final String account, final boolean group) { Collection<BwPrincipal> ms = getGroupMembers(); if (ms == null) { return false; } for (BwPrincipal mbr: ms) { if (mbr.getAccount().equals(account)) { if (group == (mbr instanceof BwGroup)) { return true; } } } return false; }
@Override public int compare(final BwPrincipal p1, final BwPrincipal p2) { if (p1.getKind() < p2.getKind()) { return -1; } if (p1.getKind() > p2.getKind()) { return 1; } return CalFacadeUtil.compareStrings(p1.getAccount(), p2.getAccount()); }
homeDir, "/", principal.getAccount(), "/", colPathElement,
@Override protected void toStringSegment(final ToString ts) { super.toStringSegment(ts); ts.append("account", getAccount()) .append("pref", getPrincipalRef()) .append("created", getCreated()) .newLine() .append("logon", getLogon()) .append("lastAccess", getLastAccess()) .append("lastModify", getLastModify()) .append("kind", getKind()); ts.append("quota", getQuota()); }
homeDir, "/", principal.getAccount(), "/", props.getBedeworkResourceDirectory(),
/** Copy this to val * * @param val BwPrincipal target */ public void copyTo(final BwPrincipal val) { val.setAccount(getAccount()); val.setPrincipalRef(getPrincipalRef()); val.setId(getId()); val.setSeq(getSeq()); val.setCreated(getCreated()); val.setLogon(getLogon()); val.setLastAccess(getLastAccess()); val.setLastModify(getLastModify()); val.setCategoryAccess(getCategoryAccess()); val.setLocationAccess(getLocationAccess()); val.setContactAccess(getContactAccess()); val.setGroups(getGroups()); // XXX this should be cloned }