public class PayloadWriter extends Object
Modifier and Type | Field and Description |
---|---|
protected CompilerFacade |
compilers |
protected Env |
env |
protected Request |
request |
protected Response |
response |
protected Site |
site |
Constructor and Description |
---|
PayloadWriter(Request request,
Response response,
Env env,
Site site,
CompilerFacade compilers) |
Modifier and Type | Method and Description |
---|---|
protected void |
close() |
protected String |
etag(byte[] data) |
protected byte[] |
forCompiledPath(CompiledPath compiledPath) |
protected byte[] |
forModelAndView(ModelAndView modelAndView) |
protected byte[] |
forPath(java.nio.file.Path path) |
protected byte[] |
forString(String value) |
protected byte[] |
forTemplatePath(java.nio.file.Path path) |
protected String |
getContentType(Object content,
String uri) |
protected byte[] |
getData(Object content,
String uri) |
protected long |
getLastModified(Payload payload) |
protected boolean |
isStream(Object content) |
protected boolean |
shouldGzip() |
protected boolean |
shouldIgnoreError(IOException e) |
protected void |
streamPayload(String uri,
Payload payload) |
protected byte[] |
toJson(Object content) |
protected void |
write(byte[] data) |
protected void |
write(Payload payload) |
void |
writeAndClose(Payload payload) |
protected void |
writeBufferedReader(Payload payload) |
protected void |
writeBytes(String uri,
Payload payload) |
protected void |
writeEventStream(Payload payload) |
protected void |
writeInputStream(Payload payload) |
protected void |
writeStreamingHeaders() |
protected final Request request
protected final Response response
protected final Env env
protected final Site site
protected final CompilerFacade compilers
public PayloadWriter(Request request, Response response, Env env, Site site, CompilerFacade compilers)
public void writeAndClose(Payload payload) throws IOException
IOException
protected void close()
protected void write(Payload payload) throws IOException
IOException
protected void writeBytes(String uri, Payload payload) throws IOException
IOException
protected void writeStreamingHeaders() throws IOException
IOException
protected void streamPayload(String uri, Payload payload) throws IOException
IOException
protected void writeEventStream(Payload payload) throws IOException
IOException
protected void writeBufferedReader(Payload payload) throws IOException
IOException
protected void writeInputStream(Payload payload) throws IOException
IOException
protected void write(byte[] data) throws IOException
IOException
protected boolean shouldGzip()
protected boolean shouldIgnoreError(IOException e)
protected String etag(byte[] data)
protected boolean isStream(Object content)
protected byte[] getData(Object content, String uri) throws IOException
IOException
protected byte[] toJson(Object content)
protected long getLastModified(Payload payload) throws IOException
IOException
protected byte[] forString(String value)
protected byte[] forModelAndView(ModelAndView modelAndView)
protected byte[] forPath(java.nio.file.Path path) throws IOException
IOException
protected byte[] forCompiledPath(CompiledPath compiledPath) throws IOException
IOException
protected byte[] forTemplatePath(java.nio.file.Path path)
Copyright © 2014. All Rights Reserved.