Module org.apache.wicket.core
Class ResourceStreamResource
java.lang.Object
org.apache.wicket.request.resource.AbstractResource
org.apache.wicket.request.resource.ResourceStreamResource
- All Implemented Interfaces:
Serializable
,IResource
,IClusterable
A
resource
that loads its data from IResourceStream
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class org.apache.wicket.request.resource.AbstractResource
AbstractResource.ContentRangeType, AbstractResource.ResourceResponse, AbstractResource.WriteCallback
Nested classes/interfaces inherited from interface org.apache.wicket.request.resource.IResource
IResource.Attributes
-
Field Summary
Fields inherited from class org.apache.wicket.request.resource.AbstractResource
CONTENT_DISPOSITION_HEADER_NAME, CONTENT_RANGE_ENDBYTE, CONTENT_RANGE_STARTBYTE, INTERNAL_HEADERS
-
Constructor Summary
ConstructorDescriptionConstructor.Constructor. -
Method Summary
Modifier and TypeMethodDescriptionprotected IResourceStream
getResourceStream
(IResource.Attributes attributes) Lazy or dynamic initialization of the wrapped IResourceStream(Writer)protected AbstractResource.ResourceResponse
newResourceResponse
(IResource.Attributes attributes) Override this method to return aAbstractResource.ResourceResponse
for the request.setCacheDuration
(Duration cacheDuration) setContentDisposition
(ContentDisposition contentDisposition) setFileName
(String fileName) setTextEncoding
(String textEncoding) Methods inherited from class org.apache.wicket.request.resource.AbstractResource
configureCache, getCachingStrategy, respond, setRequestMetaData, setRequestRangeMetaData, setResponseContentRangeHeaderFields, setResponseHeaders
-
Constructor Details
-
ResourceStreamResource
public ResourceStreamResource()Constructor. -
ResourceStreamResource
Constructor.- Parameters:
stream
- the resource stream to read from
-
-
Method Details
-
setFileName
- Parameters:
fileName
-- Returns:
- this object, for chaining
-
setContentDisposition
- Parameters:
contentDisposition
-- Returns:
- this object, for chaining
-
setTextEncoding
- Parameters:
textEncoding
-- Returns:
- this object, for chaining
-
getCacheDuration
- Returns:
- the duration for which the resource will be cached by the browser
-
setCacheDuration
- Parameters:
cacheDuration
- the duration for which the resource will be cached by the browser- Returns:
- this object, for chaining
-
getResourceStream
Lazy or dynamic initialization of the wrapped IResourceStream(Writer)- Parameters:
attributes
- The request attributes- Returns:
- the underlying IResourceStream. May be
null
.
-
newResourceResponse
Description copied from class:AbstractResource
Override this method to return aAbstractResource.ResourceResponse
for the request.- Specified by:
newResourceResponse
in classAbstractResource
- Parameters:
attributes
- request attributes- Returns:
- resource data instance
-