Class BlobImageResource

All Implemented Interfaces:
Serializable, IResource, IClusterable

public abstract class BlobImageResource extends DynamicImageResource
An ImageResource subclass for dynamic images that come from database BLOB fields. Subclasses override getBlob() to provide the image data to send back to the user. A given subclass may decide how to produce this data and whether/how to buffer it.
Eelco Hillenius
See Also:
  • Constructor Details

  • Method Details

    • getImageData

      protected byte[] getImageData(IResource.Attributes attributes)
      Description copied from class: DynamicImageResource
      Get image data for our dynamic image resource. If the subclass regenerates the data, it should set the DynamicImageResource.setLastModifiedTime(Instant) when it does so. This ensures that image caching works correctly.
      Specified by:
      getImageData in class DynamicImageResource
      attributes - the context bringing the request, response and the parameters
      The image data for this dynamic image. null means there is no image and 404 (Not found) response will be return.
    • getBlob

      protected abstract Blob getBlob(IResource.Attributes attributes)
      Gets the BLOB (Binary Large OBject) that holds the raw image data.
      attributes - the current web attributes (request, response, parameters)
      the BLOB