// handle loading and saving via javax lib
// BufferedImage bi = ImageIO.read(imageURL.openStream());
//
// ImageIO.write(bi, "jpg", file);
ImageLoader loader = new ImageLoader();
loader.load( imageURL.openStream() );
Image image = new Image( Display.getCurrent(), loader.data[0] );
if (card instanceof CardTemplateAdapter) {
CardTemplateAdapter adapter = (CardTemplateAdapter) card;
adapter.setImage(image);
}
IPath savePath = card.getStateLocation();
savePath = savePath.append("cached");
savePath.toFile().mkdirs();
savePath = savePath.append(Path.SEPARATOR + CardNameUtil.getNameOnDisk(card.getName()) + ".jpg");
monitor.subTask("Saving file to:" + savePath.toOSString()); //$NON-NLS-1$
loader.save(savePath.toOSString(), SWT.IMAGE_JPEG );
monitor.done();
return Status.OK_STATUS;
} catch ( ConnectException e ) {
e.printStackTrace();