T - The type of the data this resource can deliverpublic abstract class BaseDataResource<T> extends AbstractResource
getData(org.apache.wicket.request.resource.IResource.Attributes)AbstractResource.ContentRangeType, AbstractResource.ResourceResponse, AbstractResource.WriteCallbackIResource.AttributesCONTENT_DISPOSITION_HEADER_NAME, CONTENT_RANGE_ENDBYTE, CONTENT_RANGE_STARTBYTE, INTERNAL_HEADERS| Constructor and Description |
|---|
BaseDataResource(String contentType)
Creates a
BaseDataResource which will
provide its data dynamically with
getData(org.apache.wicket.request.resource.IResource.Attributes) |
BaseDataResource(String contentType,
T data)
Creates a Resource from the given data with its content type
|
BaseDataResource(String contentType,
T data,
String filename)
Creates a Resource from the given data with its content type and filename
|
| Modifier and Type | Method and Description |
|---|---|
protected void |
configureResponse(AbstractResource.ResourceResponse response,
IResource.Attributes attributes)
Post-configures the given response, e.g.
|
protected T |
getData(IResource.Attributes attributes)
Gets the data for this resource.
|
protected abstract Long |
getLength(T data) |
protected AbstractResource.ResourceResponse |
newResourceResponse(IResource.Attributes attributes)
Override this method to return a
AbstractResource.ResourceResponse for the request. |
protected abstract void |
writeData(Response response,
T data)
Writes the given data to the response
|
configureCache, getCachingStrategy, respond, setRequestMetaData, setRequestRangeMetaData, setResponseContentRangeHeaderFields, setResponseHeaderspublic BaseDataResource(String contentType)
BaseDataResource which will
provide its data dynamically with
getData(org.apache.wicket.request.resource.IResource.Attributes)contentType - The Content type of the array.public BaseDataResource(String contentType, T data)
contentType - The Content type of the array.data - The datapublic BaseDataResource(String contentType, T data, String filename)
contentType - The Content type of the array.data - The datafilename - The filename that will be set as the Content-Disposition header.protected void configureResponse(AbstractResource.ResourceResponse response, IResource.Attributes attributes)
response - The response to configureattributes - The request attributes (web request, web response, parameters)protected AbstractResource.ResourceResponse newResourceResponse(IResource.Attributes attributes)
AbstractResourceAbstractResource.ResourceResponse for the request.newResourceResponse in class AbstractResourceattributes - request attributesprotected abstract void writeData(Response response, T data)
response - The response to write todata - The data to writeprotected abstract Long getLength(T data)
data - The data to be writtenprotected T getData(IResource.Attributes attributes)
attributes - the context bringing the request, response and the parametersCopyright © 2006–2021 Apache Software Foundation. All rights reserved.