| java.lang.Object org.jaffa.presentation.portlet.widgets.model.WidgetModel org.jaffa.presentation.portlet.widgets.model.ImageModel
ImageModel | public class ImageModel extends WidgetModel (Code) | | Model for the Image widget. This will keep the image in memory by default.
This can however be modified to store the image in a temporary folder on the filesystem.
|
Constructor Summary | |
public | ImageModel(byte[] image) Create a new image model. | public | ImageModel(byte[] image, String extention) Create a new Image Model specifying the image type (if null, GIF is assumed). |
Method Summary | |
public void | finalize() This will ensure that the temporary file (if created) gets deleted. | public String | getExtention() Getter for property extension (image type). | public byte[] | getImage() Get the byte array for the image.
This may be in-memory, or read in from disk.
throws: IOException - if any error occurs in reading the image from the filesystem. | public String | getImageUrl() Returns the URL to access the image relative of the web server. | public String | getMimeType() Getter for property mimeType. |
ImageModel | public ImageModel(byte[] image)(Code) | | Create a new image model. The default image type is GIF.
Parameters: image - The image. |
ImageModel | public ImageModel(byte[] image, String extention)(Code) | | Create a new Image Model specifying the image type (if null, GIF is assumed).
Currently suppoted image types are : gif,png,jpeg,jpg,jpe,bmp,tif,tiff.
This will throw an IllegalExtensionRuntimeException if any other extention is passed.
Parameters: image - The image. Parameters: extention - The image type. |
finalize | public void finalize()(Code) | | This will ensure that the temporary file (if created) gets deleted.
|
getExtention | public String getExtention()(Code) | | Getter for property extension (image type).
Value of property extension (image type). |
getImage | public byte[] getImage() throws IOException(Code) | | Get the byte array for the image.
This may be in-memory, or read in from disk.
throws: IOException - if any error occurs in reading the image from the filesystem. the byte array for the image. |
getImageUrl | public String getImageUrl()(Code) | | Returns the URL to access the image relative of the web server.
the URL to access the image relative of the web server. |
getMimeType | public String getMimeType()(Code) | | Getter for property mimeType.
Value of property mimeType. |
|
|