final ContentItem contentItem =
contentLocation.createItem(nameGenerator.generateName(null, mimeType));
final BufferedImage image = interceptor.getImage();
final ImageEncoder imageEncoder = ImageEncoderRegistry.getInstance().createEncoder(mimeType);
final OutputStream outputStream = contentItem.getOutputStream();
imageEncoder.encodeImage(image, outputStream, quality, alphaChannel);
outputStream.close();
}
catch (Throwable e)
{
setError(e);