//Create a DataSource from an image
File file = new File(imageResourceDir+File.separator+"test.jpg");
ImageInputStream fiis = new FileImageInputStream(file);
Image image = ImageIO.read(fiis);
DataSource imageDS = new DataSourceImpl("image/jpeg","test.jpg",image);
//Create a DataHandler with the String DataSource object
DataHandler dataHandler = new DataHandler(imageDS);
//Store the data handler in ImageDepot bean