public abstract class AbstractResource extends Object implements IResource
newResourceResponse(org.apache.wicket.request.resource.IResource.Attributes)
method.Modifier and Type | Class and Description |
---|---|
static class |
AbstractResource.ContentRangeType
All available content range types.
|
static class |
AbstractResource.ResourceResponse
Represents data used to configure response and write resource data.
|
static class |
AbstractResource.WriteCallback
Callback invoked when resource data needs to be written to response.
|
IResource.Attributes
Modifier and Type | Field and Description |
---|---|
static String |
CONTENT_DISPOSITION_HEADER_NAME |
static MetaDataKey<Long> |
CONTENT_RANGE_ENDBYTE
The meta data key of the content range end byte
|
static MetaDataKey<Long> |
CONTENT_RANGE_STARTBYTE
The meta data key of the content range start byte
|
static Set<String> |
INTERNAL_HEADERS
header values that are managed internally and must not be set directly
|
Constructor and Description |
---|
AbstractResource()
Construct.
|
Modifier and Type | Method and Description |
---|---|
protected void |
configureCache(AbstractResource.ResourceResponse data,
IResource.Attributes attributes)
Configure the web response header for client cache control.
|
protected IResourceCachingStrategy |
getCachingStrategy() |
protected abstract AbstractResource.ResourceResponse |
newResourceResponse(IResource.Attributes attributes)
Override this method to return a
AbstractResource.ResourceResponse for the request. |
void |
respond(IResource.Attributes attributes)
Renders this resource to response using the provided attributes.
|
protected void |
setRequestMetaData(IResource.Attributes attributes)
Reads the plain request header information and applies enriched information as meta data to
the current request.
|
protected void |
setRequestRangeMetaData(WebRequest webRequest) |
protected boolean |
setResponseContentRangeHeaderFields(WebResponse webResponse,
IResource.Attributes attributes,
long contentLength)
Sets the content range header fields to the given web response
|
protected void |
setResponseHeaders(AbstractResource.ResourceResponse resourceResponse,
IResource.Attributes attributes)
Sets the response header of resource response to the response received from the attributes
|
public static final Set<String> INTERNAL_HEADERS
public static final MetaDataKey<Long> CONTENT_RANGE_STARTBYTE
public static final MetaDataKey<Long> CONTENT_RANGE_ENDBYTE
public static final String CONTENT_DISPOSITION_HEADER_NAME
protected abstract AbstractResource.ResourceResponse newResourceResponse(IResource.Attributes attributes)
AbstractResource.ResourceResponse
for the request.attributes
- request attributesprotected void configureCache(AbstractResource.ResourceResponse data, IResource.Attributes attributes)
data
- resource dataattributes
- request attributesprotected IResourceCachingStrategy getCachingStrategy()
public void respond(IResource.Attributes attributes)
IResource
respond
in interface IResource
IResource.respond(org.apache.wicket.request.resource.IResource.Attributes)
protected void setRequestMetaData(IResource.Attributes attributes)
attributes
- the attributes to get the plain request header informationprotected void setRequestRangeMetaData(WebRequest webRequest)
protected void setResponseHeaders(AbstractResource.ResourceResponse resourceResponse, IResource.Attributes attributes)
resourceResponse
- the resource response to get the header fields fromattributes
- the attributes to get the response from to which the header information are going
to be appliedprotected boolean setResponseContentRangeHeaderFields(WebResponse webResponse, IResource.Attributes attributes, long contentLength)
webResponse
- the web response to apply the content range information toattributes
- the attributes to get the request fromcontentLength
- the content length of the responseCopyright © 2006–2022 Apache Software Foundation. All rights reserved.