net.officefloor.plugin.socket.server.http.response
Class HttpResponseWriterImpl

java.lang.Object
  extended by net.officefloor.plugin.socket.server.http.response.HttpResponseWriterImpl
All Implemented Interfaces:
HttpResponseWriter

public class HttpResponseWriterImpl
extends Object
implements HttpResponseWriter

HttpResponseWriter implementation. TODO handle Accept and translating HTTP response for the client.

Author:
Daniel Sagenschneider

Constructor Summary
HttpResponseWriterImpl(ServerHttpConnection connection)
          Initiate.
 
Method Summary
 void write(String contentType, String contents)
           Writes content to the HttpResponse.
 void write(String contentEncoding, String contentType, Charset charset, ByteBuffer contents)
          Writes content to the HttpResponse.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

HttpResponseWriterImpl

public HttpResponseWriterImpl(ServerHttpConnection connection)
Initiate.

Parameters:
connection - ServerHttpConnection.
Method Detail

write

public void write(String contentEncoding,
                  String contentType,
                  Charset charset,
                  ByteBuffer contents)
           throws IOException
Description copied from interface: HttpResponseWriter
Writes content to the HttpResponse.

Specified by:
write in interface HttpResponseWriter
Parameters:
contentEncoding - Content-Encoding of the contents to write. May be null if Content-Encoding is unknown.
contentType - Content-Type of the contents to write. May be null if Content-Type is unknown.
charset - Charset of the contents to write. May be null if the contents is not text or the Charset is unknown.
contents - Contents to write to the HttpResponse.
Throws:
IOException - If fails to write contents to HttpResponse.

write

public void write(String contentType,
                  String contents)
           throws IOException
Description copied from interface: HttpResponseWriter

Writes content to the HttpResponse.

As the content is String, there should be no Content-Encoding on the contents to write.

Specified by:
write in interface HttpResponseWriter
Parameters:
contentType - Content-Type of the contents to write. May be null if Content-Type is unknown.
contents - Contents to write to the HttpResponse.
Throws:
IOException - If fails to write contents to HttpResponse.


Copyright © 2005-2011. All Rights Reserved.