Skip to content

Commit

Permalink
anonymous
Browse files Browse the repository at this point in the history
  • Loading branch information
culmat committed Apr 25, 2024
1 parent 62c5333 commit ac593e3
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/main/java/com/baloise/azure/Graph.java
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ public void clear() {
}

public byte[] avatar(String id) throws IOException {
id = "unknown_person.jpg";
try(InputStream is = graphClient.users().byUserId(id).photo().content().get()){
return is.readAllBytes();
} catch (Exception e) {
Expand All @@ -82,7 +83,10 @@ public StringTree getOrg() {
return org;
}

private String notNull(String mayBeNull) {return mayBeNull == null? "" :mayBeNull;}
private String notNull(String mayBeNull) {
String ret = mayBeNull == null? "" :mayBeNull;
return (ret + "...").substring(0, 3)+"...";
}

public Map<String, Object> loadTeam(String teamId, String ... roleNames) {
Map<String, Map<String, Object>> mail2member = new TreeMap<>();
Expand All @@ -94,7 +98,7 @@ public Map<String, Object> loadTeam(String teamId, String ... roleNames) {
mappedMember.put("displayName",notNull(member.getDisplayName()));
mappedMember.put("givenName",notNull(member.getGivenName()));
mappedMember.put("surname",notNull(member.getSurname()));
mappedMember.put("mail",notNull(member.getMail()));
mappedMember.put("mail",member.getMail());
mappedMember.put("officeLocation",notNull(member.getOfficeLocation()));
mappedMember.put("preferredLanguage",notNull(member.getPreferredLanguage()));
mappedMember.put("businessPhones",member.getBusinessPhones());
Expand Down

0 comments on commit ac593e3

Please sign in to comment.