Package org.astrogrid.samp.web
Class LoggingCorsHttpServer.LoggedResponse
- java.lang.Object
-
- org.astrogrid.samp.httpd.HttpServer.Response
-
- org.astrogrid.samp.web.LoggingCorsHttpServer.LoggedResponse
-
- Enclosing class:
- LoggingCorsHttpServer
private class LoggingCorsHttpServer.LoggedResponse extends HttpServer.Response
HTTP response which will log its content at an appropriate time.
-
-
Field Summary
Fields Modifier and Type Field Description private HttpServer.Responsebase_private java.lang.StringbodyText_private java.lang.StringheadText_private booleanlogBody_
-
Constructor Summary
Constructors Constructor Description LoggedResponse(HttpServer.Response base, int iseq, boolean logBody)Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidwriteBody(java.io.OutputStream out)Implemented to generate the bytes in the body of the response.voidwriteResponse(java.io.OutputStream out)Writes this response to an output stream in a way suitable for replying to the client.-
Methods inherited from class org.astrogrid.samp.httpd.HttpServer.Response
getHeaderMap, getStatusCode, getStatusPhrase
-
-
-
-
Field Detail
-
base_
private final HttpServer.Response base_
-
logBody_
private final boolean logBody_
-
headText_
private final java.lang.String headText_
-
bodyText_
private java.lang.String bodyText_
-
-
Constructor Detail
-
LoggedResponse
LoggedResponse(HttpServer.Response base, int iseq, boolean logBody)
Constructor.- Parameters:
base- response on which this one is basediseq- sequence number of request that this is a response tologBody- true iff the body of the response is to be logged
-
-
Method Detail
-
writeBody
public void writeBody(java.io.OutputStream out) throws java.io.IOExceptionDescription copied from class:HttpServer.ResponseImplemented to generate the bytes in the body of the response.- Specified by:
writeBodyin classHttpServer.Response- Parameters:
out- destination stream for body bytes- Throws:
java.io.IOException
-
writeResponse
public void writeResponse(java.io.OutputStream out) throws java.io.IOExceptionDescription copied from class:HttpServer.ResponseWrites this response to an output stream in a way suitable for replying to the client. Status line and any headers are written, thenHttpServer.Response.writeBody(java.io.OutputStream)is called.- Overrides:
writeResponsein classHttpServer.Response- Parameters:
out- destination stream- Throws:
java.io.IOException
-
-