Class Libravatar
- java.lang.Object
-
- org.gcube.keycloak.oidc.avatar.importer.libravatar.Libravatar
-
public class Libravatar extends Object
-
-
Field Summary
Fields Modifier and Type Field Description protected static org.slf4j.Loggerlogger
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description InputStreamdownload()Performs the avatar download by searching for a domain specific server and then on the libravatar public servicebyte[]downloadArray()Performs the avatar download by searching for a domain specific server and then on the libravatar public servicestatic Libravatarfrom(String email)Construct new libravatar downloader for the provided emailLibravatarwithOptions(LibravatarOptions options)Adds he options to be used for download
-
-
-
Method Detail
-
from
public static Libravatar from(String email)
Construct new libravatar downloader for the provided email- Parameters:
email- the email address- Returns:
- the new libravatar downloader instance
-
withOptions
public Libravatar withOptions(LibravatarOptions options)
Adds he options to be used for download- Parameters:
options- the libravatar options- Returns:
-
downloadArray
public byte[] downloadArray() throws LibravatarExceptionPerforms the avatar download by searching for a domain specific server and then on the libravatar public service- Returns:
- the avatar's byte array
- Throws:
LibravatarException- if no default has been set in options (LibravatarOptions.defaultingTo(LibravatarDefaultImage)) and the image hasn't found on remote server
-
download
public InputStream download() throws LibravatarException
Performs the avatar download by searching for a domain specific server and then on the libravatar public service- Returns:
- the avatar byte array
- Throws:
LibravatarException- if no default has been set in options (LibravatarOptions.defaultingTo(LibravatarDefaultImage)) and the image hasn't found on remote server
-
-