public class NanoResponse
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
java.io.InputStream |
data
Data of the response, may be null.
|
java.util.Properties |
header
Headers for the HTTP response.
|
java.lang.String |
mimeType
MIME type of content, e.g.
|
java.lang.String |
status
HTTP status code after processing, e.g.
|
Constructor and Description |
---|
NanoResponse()
Default constructor: response = HTTP_OK, data = mime = 'null'
|
NanoResponse(java.lang.String status,
java.lang.String mimeType,
byte[] data) |
NanoResponse(java.lang.String status,
java.lang.String mimeType,
java.io.InputStream data)
Basic constructor.
|
NanoResponse(java.lang.String status,
java.lang.String mimeType,
java.lang.String txt)
Convenience method that makes an InputStream out of given text.
|
Modifier and Type | Method and Description |
---|---|
void |
addHeader(java.lang.String name,
java.lang.String value)
Adds given line to the header.
|
void |
writeTo(java.io.OutputStream os) |
public java.lang.String status
public java.lang.String mimeType
public java.io.InputStream data
public java.util.Properties header
public NanoResponse()
public NanoResponse(java.lang.String status, java.lang.String mimeType, java.io.InputStream data)
public NanoResponse(java.lang.String status, java.lang.String mimeType, java.lang.String txt)
public NanoResponse(java.lang.String status, java.lang.String mimeType, byte[] data)