@Component(value="gravatarService") public class GravatarServiceImpl extends Object implements GravatarService
GravatarService
.Constructor and Description |
---|
GravatarServiceImpl() |
Modifier and Type | Method and Description |
---|---|
void |
cacheCleanup()
Cleans up the gravatar cache.
|
String |
computeHash(String mail)
Computes the Gravatar hash for a mail address.
|
File |
fetchGravatar(String hash)
Fetch a File of the Gravatar image for the given hash.
|
public GravatarServiceImpl()
public String computeHash(String mail)
GravatarService
computeHash
in interface GravatarService
mail
- Mail address to hashpublic File fetchGravatar(String hash) throws IOException
GravatarService
The files are cached for a certain time.
fetchGravatar
in interface GravatarService
hash
- Gravatar image hashIOException
@Scheduled(fixedDelay=3600000L) public void cacheCleanup()
Copyright © 2011–2017. All rights reserved.