Class ResourceStreamResource
- java.lang.Object
-
- org.apache.wicket.request.resource.AbstractResource
-
- org.apache.wicket.request.resource.ResourceStreamResource
-
- All Implemented Interfaces:
Serializable
,IResource
,IClusterable
public class ResourceStreamResource extends AbstractResource
Aresource
that loads its data fromIResourceStream
- See Also:
- Serialized Form
-
-
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
Constructors Constructor Description ResourceStreamResource()
Constructor.ResourceStreamResource(IResourceStream stream)
Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Duration
getCacheDuration()
protected 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.ResourceStreamResource
setCacheDuration(Duration cacheDuration)
ResourceStreamResource
setContentDisposition(ContentDisposition contentDisposition)
ResourceStreamResource
setFileName(String fileName)
ResourceStreamResource
setTextEncoding(String textEncoding)
-
Methods inherited from class org.apache.wicket.request.resource.AbstractResource
configureCache, getCachingStrategy, respond, setRequestMetaData, setRequestRangeMetaData, setResponseContentRangeHeaderFields, setResponseHeaders
-
-
-
-
Constructor Detail
-
ResourceStreamResource
public ResourceStreamResource()
Constructor.
-
ResourceStreamResource
public ResourceStreamResource(IResourceStream stream)
Constructor.- Parameters:
stream
- the resource stream to read from
-
-
Method Detail
-
setFileName
public ResourceStreamResource setFileName(String fileName)
- Parameters:
fileName
-- Returns:
- this object, for chaining
-
setContentDisposition
public ResourceStreamResource setContentDisposition(ContentDisposition contentDisposition)
- Parameters:
contentDisposition
-- Returns:
- this object, for chaining
-
setTextEncoding
public ResourceStreamResource setTextEncoding(String textEncoding)
- Parameters:
textEncoding
-- Returns:
- this object, for chaining
-
getCacheDuration
public Duration getCacheDuration()
- Returns:
- the duration for which the resource will be cached by the browser
-
setCacheDuration
public ResourceStreamResource setCacheDuration(Duration cacheDuration)
- Parameters:
cacheDuration
- the duration for which the resource will be cached by the browser- Returns:
- this object, for chaining
-
getResourceStream
protected IResourceStream getResourceStream(IResource.Attributes attributes)
Lazy or dynamic initialization of the wrapped IResourceStream(Writer)- Parameters:
attributes
- The request attributes- Returns:
- the underlying IResourceStream. May be
null
.
-
newResourceResponse
protected AbstractResource.ResourceResponse newResourceResponse(IResource.Attributes attributes)
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
-
-