Class ResourceStreamResource
- java.lang.Object
-
- org.apache.wicket.request.resource.AbstractResource
-
- org.apache.wicket.request.resource.ResourceStreamResource
-
- All Implemented Interfaces:
java.io.Serializable,IResource,org.apache.wicket.util.io.IClusterable
public class ResourceStreamResource extends AbstractResource
Aresourcethat 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(org.apache.wicket.util.resource.IResourceStream stream)Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description org.apache.wicket.util.time.DurationgetCacheDuration()protected org.apache.wicket.util.resource.IResourceStreamgetResourceStream(IResource.Attributes attributes)Lazy or dynamic initialization of the wrapped IResourceStream(Writer)protected AbstractResource.ResourceResponsenewResourceResponse(IResource.Attributes attributes)Override this method to return aAbstractResource.ResourceResponsefor the request.ResourceStreamResourcesetCacheDuration(org.apache.wicket.util.time.Duration cacheDuration)ResourceStreamResourcesetContentDisposition(ContentDisposition contentDisposition)ResourceStreamResourcesetFileName(java.lang.String fileName)ResourceStreamResourcesetTextEncoding(java.lang.String textEncoding)-
Methods inherited from class org.apache.wicket.request.resource.AbstractResource
configureCache, getCachingStrategy, respond, setRequestMetaData, setRequestRangeMetaData, setResponseContentRangeHeaderFields, setResponseHeaders
-
-
-
-
Method Detail
-
setFileName
public ResourceStreamResource setFileName(java.lang.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(java.lang.String textEncoding)
- Parameters:
textEncoding-- Returns:
- this object, for chaining
-
getCacheDuration
public org.apache.wicket.util.time.Duration getCacheDuration()
- Returns:
- the duration for which the resource will be cached by the browser
-
setCacheDuration
public ResourceStreamResource setCacheDuration(org.apache.wicket.util.time.Duration cacheDuration)
- Parameters:
cacheDuration- the duration for which the resource will be cached by the browser- Returns:
- this object, for chaining
-
getResourceStream
protected org.apache.wicket.util.resource.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:AbstractResourceOverride this method to return aAbstractResource.ResourceResponsefor the request.- Specified by:
newResourceResponsein classAbstractResource- Parameters:
attributes- request attributes- Returns:
- resource data instance
-
-