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