|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface Content
The Content
interface is used to provide an interface
to content within a Context
. The contents represented
by the Content
implementation could be dynamic or
static depending on the Context
that served it.
Static content represented by resources on the underlying file
system such as files are represented as Content
objects to provide a simple means of writing that content to HTTP
clients using an OutputStream
.
The Content
interface can also be used to provide a
means for writing dynamic content. Dynamic content such as that
produced by simple.template.Document
objects can be
implemented as a Content
. The implementation can then
be presented to the client using the write
methods.
ContentFactory
Method Summary | |
---|---|
java.lang.String |
getContentType()
The content that is dynamically generated by the object us written as a specific MIME type, including charset information which determines the content encoding. |
java.lang.String |
toString()
This method is used to embed the generated contents into other strings and capture the value of the content as a string. |
void |
write(java.io.OutputStream out)
This writes the contents of the instance to the issued stream. |
Method Detail |
---|
void write(java.io.OutputStream out) throws java.io.IOException
Content
to write
its contents to an OutputStream
. Typically this
is used by Service
objects when data is to be
provided to the client using the Response
. Any
problems in writing the contents results in an exception.
out
- this is the stream to write the content with
java.io.IOException
- thrown if there is an I/O problemjava.lang.String getContentType()
java.lang.String toString()
toString
in class java.lang.Object
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |