java.lang.Object
org.apache.wicket.request.resource.AbstractResource
org.apache.wicket.request.resource.BaseDataResource<CharSequence>
org.apache.wicket.request.resource.CharSequenceResource
- All Implemented Interfaces:
Serializable
,IResource
,IClusterable
An
IResource
for CharSequences.
The char sequence can be static - passed to the constructor,
or dynamic - by overriding BaseDataResource.getData(org.apache.wicket.request.resource.IResource.Attributes)
- 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
ConstructorDescriptionCharSequenceResource
(String contentType) Creates aCharSequenceResource
which will provide its data dynamically withBaseDataResource.getData(org.apache.wicket.request.resource.IResource.Attributes)
CharSequenceResource
(String contentType, CharSequence data) Creates a Resource from the given char sequence with its content typeCharSequenceResource
(String contentType, CharSequence data, String filename) Creates a Resource from the given char sequence with its content type -
Method Summary
Modifier and TypeMethodDescriptionprotected Charset
protected Long
getLength
(CharSequence data) void
setCharset
(Charset charset) Sets the character set used for reading this resource.protected void
writeData
(Response response, CharSequence data) Writes the given data to the responseMethods inherited from class org.apache.wicket.request.resource.BaseDataResource
configureResponse, getData, getFilename, newResourceResponse
Methods inherited from class org.apache.wicket.request.resource.AbstractResource
configureCache, getCachingStrategy, respond, setRequestMetaData, setRequestRangeMetaData, setResponseContentRangeHeaderFields, setResponseHeaders
-
Constructor Details
-
CharSequenceResource
Creates aCharSequenceResource
which will provide its data dynamically withBaseDataResource.getData(org.apache.wicket.request.resource.IResource.Attributes)
- Parameters:
contentType
- The Content type of the array.
-
CharSequenceResource
Creates a Resource from the given char sequence with its content type- Parameters:
contentType
- The Content type of the array.data
- The data
-
CharSequenceResource
Creates a Resource from the given char sequence with its content type- Parameters:
contentType
- The Content type of the array.data
- The datafilename
- The filename that will be set as the Content-Disposition header.
-
-
Method Details
-
writeData
Description copied from class:BaseDataResource
Writes the given data to the response- Specified by:
writeData
in classBaseDataResource<CharSequence>
- Parameters:
response
- The response to write todata
- The data to write
-
getLength
- Specified by:
getLength
in classBaseDataResource<CharSequence>
- Parameters:
data
- The data to be written- Returns:
- The length of the data to be written. Used to set "Content-Length" response header
-
getCharset
- Returns:
- Charset for resource
-
setCharset
Sets the character set used for reading this resource.- Parameters:
charset
- Charset for component
-