|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectorg.apache.cocoon.util.AbstractLogEnabled
org.apache.cocoon.reading.AbstractReader
org.apache.cocoon.reading.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 org.apache.cocoon.environment.Request |
request
|
protected org.apache.cocoon.environment.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)
Deprecated. use property injection instead |
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()
|
protected void |
processStream(InputStream inputStream)
|
void |
recycle()
Recyclable |
void |
setBufferSize(int bufferSize)
|
void |
setByteRanges(boolean byteRanges)
This parameter is optional. |
void |
setExpires(long expires)
This parameter is optional. |
void |
setQuickTest(boolean quickTest)
This parameter is optional. |
void |
setup(org.apache.cocoon.environment.SourceResolver resolver,
Map objectModel,
String src,
Parameters par)
Setup the reader. |
protected void |
setupHeaders()
Setup the response headers: Accept-Ranges, Expires, Last-Modified |
| Methods inherited from class org.apache.cocoon.reading.AbstractReader |
setOutputStream, shouldSetContentLength |
| Methods inherited from class org.apache.cocoon.util.AbstractLogEnabled |
getLogger, setLogger |
| 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 org.apache.cocoon.environment.Response response
protected org.apache.cocoon.environment.Request request
protected Source inputSource
| Constructor Detail |
public ResourceReader()
| Method Detail |
public void setBufferSize(int bufferSize)
bufferSize - public void setByteRanges(boolean byteRanges)
byteRanges - public void setExpires(long expires)
expires - public void setQuickTest(boolean quickTest)
quickTest -
public void configure(Configuration configuration)
throws ConfigurationException
configure in interface ConfigurableConfigurationException
public void setup(org.apache.cocoon.environment.SourceResolver resolver,
Map objectModel,
String src,
Parameters par)
throws org.apache.cocoon.ProcessingException,
SAXException,
IOException
InputStream,
the length and the last modification date
setup in interface org.apache.cocoon.sitemap.SitemapModelComponentorg.apache.cocoon.ProcessingException
SAXException
IOExceptionprotected void setupHeaders()
public void recycle()
recycle in interface Recyclableprotected boolean hasRanges()
public Serializable getKey()
getKey in interface org.apache.cocoon.caching.CacheableProcessingComponentpublic SourceValidity getValidity()
getValidity in interface org.apache.cocoon.caching.CacheableProcessingComponentnull if the
component is currently not cacheable.public long getLastModified()
getLastModified in interface org.apache.cocoon.reading.Reader
protected void processStream(InputStream inputStream)
throws IOException,
org.apache.cocoon.ProcessingException
IOException
org.apache.cocoon.ProcessingException
public void generate()
throws IOException,
org.apache.cocoon.ProcessingException
generate in interface org.apache.cocoon.reading.ReaderIOException
org.apache.cocoon.ProcessingExceptionpublic String getMimeType()
getMimeType in interface org.apache.cocoon.sitemap.SitemapOutputComponent
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||