    All Packages  Class Hierarchy  This Package  Previous  Next  Index

# Class w3c.www.protocol.http.Reply

    java.lang.Object
       |
       +----w3c.www.http.HttpMessage
               |
               +----w3c.www.http.HttpEntityMessage
                       |
                       +----w3c.www.http.HttpReplyMessage
                               |
                               +----w3c.www.protocol.http.Reply

public class Reply
extends HttpReplyMessage

##

DEFAULT_TYPE
definesInput
input

##

getInputStream()
  Get this reply entity body.
hasInputStream()
  Does this reply has an associated entity stream ?
keepsAlive()
matchesRequest(Request)
  Notify this reply that is has been built to answer given request.
setContent(String)
  Set this reply content.
setStream(InputStream)
  Set this reply's input stream.
setStreamObserver(HttpStreamObserver)
  Set an stream observer on the repkly entity stream.

##

DEFAULT_TYPE

     protected static HttpMimeType DEFAULT_TYPE

input

     protected InputStream input

definesInput

     protected boolean definesInput

##

keepsAlive

     public boolean keepsAlive()

setStreamObserver

     protected void setStreamObserver(HttpStreamObserver observer)

  Set an stream observer on the repkly entity stream. This method should be called before any caller gets a chance to execute `getInputStream`. It is needed for HttpServer instances to be notified when the stream becomes available for the next request.

matchesRequest

     protected void matchesRequest(Request request)

  Notify this reply that is has been built to answer given request. Perform has many ugly hack HTTP/1.1 requires.

  Parameters:
    request - The request that is answered by this reply.

setStream

     public void setStream(InputStream input)

  Set this reply's input stream.

  Parameters:
    input - The stream to read the reply's entity from.

getInputStream

     public InputStream getInputStream() throws IOException

  Get this reply entity body. The reply entity body is returned as an InputStream, that the caller has to read to actually get the bytes of the content.

  Returns:
    An InputStream instance. If the reply has no body, the returned input stream will just return -1 on first read.

hasInputStream

     public boolean hasInputStream() throws IOException

  Does this reply has an associated entity stream ?

  Returns:
    A boolean, true if the reply has an entity stream, false otherwise.

setContent

     public void setContent(String msg)

  Set this reply content. This method allows to set the reply content to a simple String instance.

  Parameters:
    msg - The reply content.

    All Packages  Class Hierarchy  This Package  Previous  Next  Index