| org.apache.cocoon.reading.AbstractReader org.apache.cocoon.reading.ResourceReader
All known Subclasses: org.apache.cocoon.reading.imageop.ImageOpReader, org.apache.cocoon.samples.EventAwareReader, org.apache.cocoon.reading.ImageReader,
ResourceReader | public class ResourceReader extends AbstractReader implements CacheableProcessingComponent,Configurable(Code) | | The ResourceReader component is used to serve binary data
in a sitemap pipeline. It makes use of HTTP Headers to determine if
the requested resource should be written to the OutputStream
or if it can signal that it hasn't changed.
Configuration:
- <expires>
- This parameter is optional. When specified it determines how long
in miliseconds the resources can be cached by any proxy or browser
between Cocoon and the requesting visitor. Defaults to -1.
- <quick-modified-test>
- This parameter is optional. This boolean parameter controls the
last modified test. If set to true (default is false), only the
last modified of the current source is tested, but not if the
same source is used as last time
(see http://marc.theaimsgroup.com/?l=xml-cocoon-dev&m=102921894301915 )
- <byte-ranges>
- This parameter is optional. This boolean parameter controls whether
Cocoon should support byterange requests (to allow clients to resume
broken/interrupted downloads).
Defaults to true.
Default configuration:
<expires>-1</expires>
<quick-modified-test>false</quick-modified-test>
<byte-ranges>true</byte-ranges>
In addition to reader configuration, above parameters can be passed
to the reader at the time when it is used.
author: Giacomo Pati author: Torsten Curdt author: Carsten Ziegeler version: CVS $Id: ResourceReader.java 492792 2007-01-04 22:45:55Z joerg $ |
bufferSize | protected int bufferSize(Code) | | |
byteRanges | protected boolean byteRanges(Code) | | |
configuredBufferSize | protected int configuredBufferSize(Code) | | |
configuredByteRanges | protected boolean configuredByteRanges(Code) | | |
configuredExpires | protected long configuredExpires(Code) | | |
configuredQuickTest | protected boolean configuredQuickTest(Code) | | |
expires | protected long expires(Code) | | |
inputSource | protected Source inputSource(Code) | | |
quickTest | protected boolean quickTest(Code) | | |
configure | public void configure(Configuration configuration) throws ConfigurationException(Code) | | Read reader configuration
|
getKey | public Serializable getKey()(Code) | | Generate the unique key.
This key must be unique inside the space of this component.
The generated key hashes the src |
getLastModified | public long getLastModified()(Code) | | the time the read source was last modified or 0 if it is notpossible to detect |
getMimeType | public String getMimeType()(Code) | | Returns the mime-type of the resource in process.
|
getValidity | public SourceValidity getValidity()(Code) | | Generate the validity object.
The generated validity object or null if thecomponent is currently not cacheable. |
hasRanges | protected boolean hasRanges()(Code) | | True if byte ranges support is enabled and request has range header. |
parameterize | public void parameterize(Parameters parameters) throws ParameterException(Code) | | |
recycle | public void recycle()(Code) | | Recyclable
|
setupHeaders | protected void setupHeaders()(Code) | | Setup the response headers: Accept-Ranges, Expires, Last-Modified
|
|
|