Gets the image that has been uploaded to the database.
@param id The image id.
@return The image.
*/
public static Result getImage(long id) {
Image image = Image.find.byId(id);
if (image == null) {
throw new RuntimeException("Could not find the image with associated id.");
}
`/**
@return The image. */ public static Result getImage(long id) { Image image = Image.find.byId(id); if (image == null) { throw new RuntimeException("Could not find the image with associated id."); }
return ok(image.data).as("image"); }`