|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.avalon.framework.logger.AbstractLogEnabled
org.apache.cocoon.reading.AbstractReader
org.apache.cocoon.reading.ResourceReader
public class ResourceReader
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:
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.
| Field Summary | |
|---|---|
protected int |
bufferSize
|
protected boolean |
byteRanges
|
protected int |
configuredBufferSize
|
protected boolean |
configuredByteRanges
|
protected long |
configuredExpires
|
protected boolean |
configuredQuickTest
|
protected long |
expires
|
protected Source |
inputSource
|
protected boolean |
quickTest
|
protected Request |
request
|
protected Response |
response
|
| Fields inherited from class org.apache.cocoon.reading.AbstractReader |
|---|
objectModel, out, parameters, resolver, source |
| Fields inherited from interface org.apache.cocoon.reading.Reader |
|---|
ROLE |
| Constructor Summary | |
|---|---|
ResourceReader()
|
|
| Method Summary | |
|---|---|
void |
configure(Configuration configuration)
Read reader configuration |
void |
generate()
Generates the requested resource. |
Serializable |
getKey()
Generate the unique key. |
long |
getLastModified()
|
String |
getMimeType()
Returns the mime-type of the resource in process. |
SourceValidity |
getValidity()
Generate the validity object. |
protected boolean |
hasRanges()
|
void |
parameterize(Parameters parameters)
|
protected void |
processStream(InputStream inputStream)
|
void |
recycle()
Recyclable |
void |
setup(SourceResolver resolver,
Map objectModel,
String src,
Parameters par)
Setup the reader. |
protected void |
setupHeaders()
Setup the response headers: Accept-Ranges, Expires |
| Methods inherited from class org.apache.cocoon.reading.AbstractReader |
|---|
setOutputStream, shouldSetContentLength |
| Methods inherited from class org.apache.avalon.framework.logger.AbstractLogEnabled |
|---|
enableLogging, getLogger, setupLogger, setupLogger, setupLogger |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected long configuredExpires
protected boolean configuredQuickTest
protected int configuredBufferSize
protected boolean configuredByteRanges
protected long expires
protected boolean quickTest
protected int bufferSize
protected boolean byteRanges
protected Response response
protected Request request
protected Source inputSource
| Constructor Detail |
|---|
public ResourceReader()
| Method Detail |
|---|
public void configure(Configuration configuration)
throws ConfigurationException
configure in interface ConfigurableConfigurationException
public void parameterize(Parameters parameters)
throws ParameterException
ParameterException
public void setup(SourceResolver resolver,
Map objectModel,
String src,
Parameters par)
throws ProcessingException,
SAXException,
IOException
InputStream,
the length and the last modification date
setup in interface SitemapModelComponentsetup in class AbstractReaderProcessingException
SAXException
IOExceptionprotected void setupHeaders()
public void recycle()
recycle in interface Recyclablerecycle in class AbstractReaderprotected boolean hasRanges()
public Serializable getKey()
getKey in interface CacheableProcessingComponentpublic SourceValidity getValidity()
getValidity in interface CacheableProcessingComponentnull if the
component is currently not cacheable.public long getLastModified()
getLastModified in interface ReadergetLastModified in class AbstractReader
protected void processStream(InputStream inputStream)
throws IOException,
ProcessingException
IOException
ProcessingException
public void generate()
throws IOException,
ProcessingException
generate in interface ReaderIOException
ProcessingExceptionpublic String getMimeType()
getMimeType in interface SitemapOutputComponentgetMimeType in class AbstractReaderAbstractProcessingPipeline.setMimeTypeForSerializer(org.apache.cocoon.environment.Environment),
AbstractProcessingPipeline.setMimeTypeForReader(org.apache.cocoon.environment.Environment)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||