- All Superinterfaces:
AutoCloseable
,Closeable
,IClusterable
,IModifiable
,Serializable
- All Known Subinterfaces:
IResourceStreamWriter
,IStringResourceStream
- All Known Implementing Classes:
AbstractResourceStream
,AbstractResourceStreamWriter
,AbstractStringResourceStream
,CssTemplate
,ExportToolbar.DataExportResourceStreamWriter
,FileResourceStream
,FileSystemResourceStream
,JavaScriptTemplate
,MarkupResourceStream
,PackageResourceStream
,PackageTextTemplate
,ResourceStreamWrapper
,StringBufferResourceStream
,StringResourceStream
,TextTemplate
,TextTemplateDecorator
,UrlResourceStream
,WebExternalResourceStream
,XSLTResourceStream
,ZipResourceStream
Interface 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.
- Author:
- Jonathan Locke
-
Method Summary
Modifier and TypeMethodDescriptionvoid
close()
Closes the resource.Gets the mime type of this resourceGets the resource stream.getStyle()
length()
Gets the size of this resourcevoid
This method shouldn't be used from the outside.void
This method shouldn't be used from the outside.void
setVariation
(String variation) This method shouldn't be used from the outside.Methods inherited from interface org.apache.wicket.util.watch.IModifiable
lastModifiedTime
-
Method Details
-
getContentType
Gets the mime type of this resource- Returns:
- The mime type of this resource, such as "image/jpeg" or "text/html". Return null to let ResourceStreamRequestHandler handle the Content-Type automatically
-
length
Gets the size of this resource- Returns:
- The size of this resource in the number of bytes, or
null
if unknown
-
getInputStream
Gets the resource stream. You should not directly close this stream. Instead call the close() method on IResourceStream.- Returns:
- Returns the inputStream.
- Throws:
ResourceStreamNotFoundException
- See Also:
-
close
Closes the resource. Normally, this includes closing any underlying input stream returned by getInputStream().- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
- Throws:
IOException
-
getLocale
- Returns:
- The Locale where this stream did resolve to
-
setLocale
This method shouldn't be used from the outside. It is used by the Loaders to set the resolved locale.- Parameters:
locale
- The Locale where this stream did resolve to.
-
getStyle
- Returns:
- The Style where this stream did resolve to
-
setStyle
This method shouldn't be used from the outside. It is used by the Loaders to set the resolved Style.- Parameters:
style
- The style where this stream did resolve to.
-
getVariation
- Returns:
- The Variation where this stream did resolve to
-
setVariation
This method shouldn't be used from the outside. It is used by the Loaders to set the resolved variation.- Parameters:
variation
- The Variation where this stream did resolve to.
-