- All Known Implementing Classes:
public interface IResourceStream extends IModifiable, IClusterable, CloseableInterface to a streamed resource. The resource stream can be retrieved by calling getInputStream(), but the resource should later be closed by calling close() on the IResourceStream (as opposed to calling close on the InputStream returned by getInputStream()).
Once a resource has been closed with a call to close(), it is normally possible to call getInputStream() again to retrieve a new input stream on the same resource.
Implementations of this interface are typically unsafe for use from multiple threads.
- Jonathan Locke
All Methods Instance Methods Abstract Methods Modifier and Type Method Description
close()Closes the resource.
getContentType()Gets the mime type of this resource
getInputStream()Gets the resource stream.
length()Gets the size of this resource
setLocale(Locale locale)This method shouldn't be used from the outside.
setStyle(String style)This method shouldn't be used from the outside.
setVariation(String variation)This method shouldn't be used from the outside.
getContentTypeGets the mime type of this resource
- The mime type of this resource, such as "image/jpeg" or "text/html". Return null to let ResourceStreamRequestHandler handle the Content-Type automatically
lengthGets the size of this resource
- The size of this resource in the number of bytes, or
getInputStreamGets the resource stream. You should not directly close this stream. Instead call the close() method on IResourceStream.
void close() throws IOExceptionCloses the resource. Normally, this includes closing any underlying input stream returned by getInputStream().
setLocaleThis method shouldn't be used from the outside. It is used by the Loaders to set the resolved locale.
locale- The Locale where this stream did resolve to.
setStyleThis method shouldn't be used from the outside. It is used by the Loaders to set the resolved Style.
style- The style where this stream did resolve to.