Package org.sakaiproject.profile2.model
Class ProfileImage
- java.lang.Object
-
- org.sakaiproject.profile2.model.ProfileImage
-
public class ProfileImage extends Object
ProfileImageResourceThis is a wrapper class which contains fields for all types of profile images. Only one field will be set at any given time.
Use the getBinary or getUrl methods to do the work and return the data as either a String or byte[]. If String, this will be a URL/URI you can use directly. If byte[] this will be the uploaded image. Consult both.
Note. Eventually, this will return only Strings. The byte[] will be base64 encoded and returned as a data URI you can use, however this is not supported in browsers older than IE8 (Safari, Firefox, Chrome, all ok though).
You can get alt text for the image via getAltText()
This is not related to the similarly named hibernate model (hbm.model.ProfileImage)
- Author:
- Steve Swinsburg (steve.swinsburg@gmail.com)
-
-
Constructor Summary
Constructors Constructor Description ProfileImage()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description byte[]getBinary()Get access to the binary data from either the uploaded image or the base64 encoded dataStringgetUrl()Get access to the URL from either the external image that a user can set, or an official image.
-
-
-
Method Detail
-
getBinary
public byte[] getBinary()
Get access to the binary data from either the uploaded image or the base64 encoded data- Returns:
- byte[] or null if none
-
getUrl
public String getUrl()
Get access to the URL from either the external image that a user can set, or an official image.- Returns:
- url or null.
-
-