|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.atlassian.bamboo.user.gravatar.GravatarServiceImpl
public class GravatarServiceImpl
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.
Constructor Summary | |
---|---|
GravatarServiceImpl(AdministrationConfigurationManager administrationConfigurationManager)
|
Method Summary | |
---|---|
byte[] |
download(java.lang.String email,
int size)
Downloads the gravatar for the given URL using Java URL and returns a byte array containing the gravatar
jpg, returns null if no gravatar was found. |
java.lang.String |
getDefaultGravatarUrl(int size)
Returns the url for the default gravatar. |
java.lang.String |
getGravatarUrl(java.lang.String email)
Returns A gravatar for the given emails with the default size of 25 pixels. |
java.lang.String |
getGravatarUrl(java.lang.String email,
int size)
|
boolean |
isGravatarSupportEnabled()
|
void |
setGravatarSupported(boolean enabled)
Updates whether or not gravatars are enabled for this Bamboo instance |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public GravatarServiceImpl(AdministrationConfigurationManager administrationConfigurationManager)
Method Detail |
---|
@Nullable public java.lang.String getGravatarUrl(@Nullable java.lang.String email, int size)
getGravatarUrl
in interface GravatarService
email
- to get gravatar url forsize
- Specify a gravatar size between 1 and 512 pixels.
@Nullable public java.lang.String getGravatarUrl(@Nullable java.lang.String email)
getGravatarUrl
in interface GravatarService
email
- to get gravatar url for
@Nullable public java.lang.String getDefaultGravatarUrl(int size)
getDefaultGravatarUrl
in interface GravatarService
size
- a gravatar size between 1 and 512 pixels.
public byte[] download(java.lang.String email, int size) throws GravatarDownloadException
URL
and returns a byte array containing the gravatar
jpg, returns null if no gravatar was found.
email
- to get gravatar forsize
- a gravatar size between 1 and 512 pixels.
GravatarDownloadException
- if something goes wrong...public void setGravatarSupported(boolean enabled)
setGravatarSupported
in interface GravatarService
enabled
- whether its enabled or notpublic boolean isGravatarSupportEnabled()
isGravatarSupportEnabled
in interface GravatarService
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |