@@ -0,0 +1,1646 @@
+package org.urlMonitor.service;%0A%0Aimport java.security.MessageDigest;%0Aimport java.security.NoSuchAlgorithmException;%0A%0Aimport lombok.extern.slf4j.Slf4j;%0A%0Aimport org.apache.commons.lang3.StringUtils;%0Aimport org.springframework.context.annotation.Scope;%0Aimport org.springframework.stereotype.Service;%0A%0A/**%0A * @author Alex Eng %3Ca href=%22mailto:aeng@redhat.com%22%3Eaeng@redhat.com%3C/a%3E%0A */%0A@Service%0A@Scope(%22singleton%22)%0A@Slf4j%0Apublic class AvatarService%0A%7B%0A   private static final String GRAVATAR_URL = %22http://www.gravatar.com/avatar/%22;%0A%0A   private static final String DEFAULT_AVATAR = %22resources/images/user.png%22;%0A%0A   public String getUserAvatar(String email, Integer size)%0A   %7B%0A      if (StringUtils.isEmpty(email))%0A      %7B%0A         return DEFAULT_AVATAR;%0A      %7D%0A%0A      try%0A      %7B%0A         if (size != null)%0A         %7B%0A            return GRAVATAR_URL + getEmailHash(email) + %22?s=%22 + size;%0A         %7D%0A         else%0A         %7B%0A            return GRAVATAR_URL + getEmailHash(email);%0A         %7D%0A      %7D%0A      catch (NoSuchAlgorithmException e)%0A      %7B%0A         log.error(%22Unable to generate email hash.%22);%0A         return DEFAULT_AVATAR;%0A      %7D%0A   %7D%0A%0A   private String getEmailHash(String email) throws NoSuchAlgorithmException%0A   %7B%0A      MessageDigest md = MessageDigest.getInstance(%22MD5%22);%0A      md.update(email.getBytes());%0A%0A      byte byteData%5B%5D = md.digest();%0A%0A      StringBuilder sb = new StringBuilder();%0A      for (int i = 0; i %3C byteData.length; i++)%0A      %7B%0A         sb.append(Integer.toString((byteData%5Bi%5D & 0xff) + 0x100, 16).substring(1));%0A      %7D%0A%0A      log.info(%22Digest(in hex format):: %22 + sb.toString());%0A      return sb.toString();%0A   %7D%0A%7D%0A

Work in progress: user avatar