to.etc.domui.util.images
Interface IImageReference

All Superinterfaces:
java.io.Closeable
All Known Implementing Classes:
FileImageReference

public interface IImageReference
extends java.io.Closeable

This is a reference to some individual original image as returned by IImageRetriever. It is a must-close resource.

Author:
Frits Jalvingh Created on Nov 30, 2009

Method Summary
 void close()
           
 java.io.InputStream getInputStream()
          Returns the datastream containing this image.
 java.lang.String getMimeType()
          This must return the image's actual mime type.
 long getVersionLong()
          If this retriever accesses resources that can change after use this must return some usable indication of the version, usually a "last date changed" timestamp.
 

Method Detail

close

void close()
           throws java.io.IOException
Specified by:
close in interface java.io.Closeable
Throws:
java.io.IOException

getVersionLong

long getVersionLong()
                    throws java.lang.Exception
If this retriever accesses resources that can change after use this must return some usable indication of the version, usually a "last date changed" timestamp. This value should remain unchanged over invocations if the object accessed has not changed. It should return -1 if the source object has been deleted; it should return 0 if the timestamp does not matter. This gets called multiple times; it should be fast.

Returns:
Throws:
java.lang.Exception

getMimeType

@Nonnull
java.lang.String getMimeType()
                             throws java.lang.Exception
This must return the image's actual mime type.

Returns:
Throws:
java.lang.Exception

getInputStream

java.io.InputStream getInputStream()
                                   throws java.lang.Exception
Returns the datastream containing this image. This may be called only ONCE for an image and must be closed after use.

Returns:
Throws:
java.lang.Exception