Image newImage = imagesService.applyTransform(crop, oldImage);
FileService fileService = FileServiceFactory.getFileService();
AppEngineFile file = fileService.createNewBlobFile("image/jpg");
byte[] data = newImage.getImageData();
FileWriteChannel writeChannel = fileService.openWriteChannel(file, true);
// This time we write to the channel directly
writeChannel.write(ByteBuffer.wrap(data));
// Now finalize
writeChannel.closeFinally();
//if(blobKey !=null) //delete the existing blob first -- GOT ERROR here....
// blobstoreService.delete(blobKey);
// Now read from the file using the Blobstore API
blobKey = fileService.getBlobKey(file);
String[] json = {blobKey.getKeyString()};