Package alpine.server.util
Class GravatarUtil
java.lang.Object
alpine.server.util.GravatarUtil
A collection of methods that help integrate user Gravatar's.
- Since:
- 1.0.0
- Author:
- Steve Springett
-
Method Summary
Modifier and TypeMethodDescriptionstatic StringgenerateHash(String emailAddress) Generates a hash value from the specified email address.static StringgetGravatarUrl(UserPrincipal userPrincipal) Generates a Gravatar URL for the specified principal.static StringgetGravatarUrl(UserPrincipal userPrincipal, int size) Generates a Gravatar URL for the specified principal.static StringgetGravatarUrl(String emailAddress) Generates a Gravatar URL for the specified email address.static StringgetGravatarUrl(String emailAddress, int size) Generates a Gravatar URL for the specified email address.
-
Method Details
-
generateHash
Generates a hash value from the specified email address. Returns null if emailAddress is empty or null.- Parameters:
emailAddress- the email address to generate a hash from- Returns:
- a hash value of the specified email address
- Since:
- 1.0.0
-
getGravatarUrl
Generates a Gravatar URL for the specified principal. If the principal does not have an email address or the email address does not have a Gravatar, will fallback to using the mystery-man image.- Parameters:
userPrincipal- the user principal to generate a Gravatar URL from- Returns:
- a Gravatar URL for the specified principal
- Since:
- 1.0.0
-
getGravatarUrl
Generates a Gravatar URL for the specified principal. If the principal does not have an email address or the email address does not have a Gravatar, will fallback to using the mystery-man image.- Parameters:
userPrincipal- the user principal to generate a Gravatar URL fromsize- the size of the image- Returns:
- a Gravatar URL for the specified principal
- Since:
- 1.0.0
-
getGravatarUrl
Generates a Gravatar URL for the specified email address. If the email address is blank or does not have a Gravatar, will fallback to usingthe mystery-man image.- Parameters:
emailAddress- the email address to generate the Gravatar URL from- Returns:
- a Gravatar URL for the specified email address
- Since:
- 1.0.0
-
getGravatarUrl
Generates a Gravatar URL for the specified email address. If the email address is blank or does not have a Gravatar, will fallback to usingthe mystery-man image.- Parameters:
emailAddress- the email address to generate the Gravatar URL fromsize- the size of the image- Returns:
- a Gravatar URL for the specified email address
- Since:
- 1.0.0
-