Interface GravatarService
-
- All Known Implementing Classes:
GravatarServiceImpl
public interface GravatarService
A gravatar is a dynamic image resource that is requested from the gravatar.com server. This class calculates the gravatar url and fetches gravatar images. See http://en.gravatar.com/site/implement/url .This class is thread-safe, Gravatar objects can be shared.
Currently this service is set to only allow images for general audiences and the Default image is hardcoded.
-
-
Field Summary
Fields Modifier and Type Field Description static String
DEFAULT_GRAVATAR_URL
-
Method Summary
All Methods Instance Methods Abstract Methods Deprecated Methods Modifier and Type Method Description @Nullable String
getDefaultGravatarUrl(int size)
Deprecated.since 9.4 use the defaults provided by DiskAvatarRepository@NotNull String
getGravatarServerUrl()
@Nullable String
getGravatarUrl(@Nullable String email)
Returns A gravatar for the given emails with the default size of 25 pixels.@Nullable String
getGravatarUrl(@Nullable String email, int size)
boolean
isGravatarSupportEnabled()
void
setGravatarSupported(boolean enabled, @NotNull String newUrl)
Updates whether or not gravatars are enabled for this Bamboo instance
-
-
-
Field Detail
-
DEFAULT_GRAVATAR_URL
static final String DEFAULT_GRAVATAR_URL
- See Also:
- Constant Field Values
-
-
Method Detail
-
getGravatarUrl
@Nullable @Nullable String getGravatarUrl(@Nullable @Nullable String email, int size)
- Parameters:
email
- to get gravatar url forsize
- Specify a gravatar size between 1 and 512 pixels.- Returns:
- url to the users image on the gravatar server
-
getGravatarUrl
@Nullable @Nullable String getGravatarUrl(@Nullable @Nullable String email)
Returns A gravatar for the given emails with the default size of 25 pixels.- Parameters:
email
- to get gravatar url for- Returns:
- url to the users image on the gravatar server
-
getDefaultGravatarUrl
@Deprecated @Nullable @Nullable String getDefaultGravatarUrl(int size)
Deprecated.since 9.4 use the defaults provided by DiskAvatarRepositoryReturns the url for the default gravatar.- Parameters:
size
- a gravatar size between 1 and 512 pixels.- Returns:
- the url for the default gravatar.
-
setGravatarSupported
void setGravatarSupported(boolean enabled, @NotNull @NotNull String newUrl)
Updates whether or not gravatars are enabled for this Bamboo instance- Parameters:
enabled
- whether its enabled or notnewUrl
- the URL of the Gravatar server the user wants to use
-
isGravatarSupportEnabled
boolean isGravatarSupportEnabled()
- Returns:
- true if gravatar support enabled.
-
getGravatarServerUrl
@NotNull @NotNull String getGravatarServerUrl()
- Returns:
- the String value of the URL of the Gravatar server being used
-
-