| java.lang.Object simple.http.serve.Component simple.http.serve.IndexedComponent simple.http.serve.ContentComponent
All known Subclasses: simple.http.serve.FileComponent,
ContentComponent | abstract class ContentComponent extends IndexedComponent (Code) | | The ContentComponent object is used to provide a
resource that delegates to the Context for acquiring
content. The performance of a content resource is dependant on
the provided context implementation as all resources within the
host file system will be taken from the provided instance. For
high performance the CacheContext is recommended.
This is also an IndexedComponent , which means all
meta data related to the target can be acquired. This provides
information such as the locale, file length, path, and other
such useful information. It the content for a required resource
cannot be acquired a ContentException is thrown.
author: Niall Gallagher See Also: simple.http.serve.CacheContext |
Method Summary | |
protected void | write(OutputStream out) This method is provided so that subclasses can write content
easily. |
ContentComponent | protected ContentComponent(Context context, String target)(Code) | | Constructor for the ContentComponent object. This
requires the context to locate the resource and the name of
the target that this instance is to emit. The target name is
given to the context to acquire the Content .
Parameters: target - the HTTP request URI that represents this Parameters: context - this is the root context of the resource |
write | protected void write(OutputStream out) throws IOException(Code) | | This method is provided so that subclasses can write content
easily. This will acquire the targeted Content
object and use its write method to emit it. If
the content for the target resource cannot be acquired then
a ContentException will be thrown.
Parameters: out - this is the output stream to the content to exception: IOException - thrown if there is a I/O error |
Methods inherited from simple.http.serve.Component | public void handle(Request req, Response resp)(Code)(Java Doc) public void handle(Request req, Response resp, int code)(Code)(Java Doc) public void handle(Request req, Response resp, Report report)(Code)(Java Doc) protected void process(Request req, Response resp, int code) throws Exception(Code)(Java Doc) protected void process(Request req, Response resp, Report report) throws Exception(Code)(Java Doc) abstract protected void process(Request req, Response resp) throws Exception(Code)(Java Doc)
|
|
|