public class StatusHeader extends Result
Constructor and Description |
---|
StatusHeader(int status) |
Modifier and Type | Method and Description |
---|---|
Result |
chunked(akka.stream.javadsl.Source<akka.util.ByteString,?> chunks)
Send a chunked response with the given chunks.
|
Result |
sendEntity(HttpEntity entity) |
Result |
sendFile(java.io.File file)
Sends the given file using the default inline mode.
|
Result |
sendFile(java.io.File file,
boolean inline)
Sends the given file.
|
Result |
sendFile(java.io.File file,
boolean inline,
java.lang.String fileName)
Send the given file.
|
Result |
sendFile(java.io.File file,
java.lang.String fileName)
Send the given file.
|
Result |
sendInputStream(java.io.InputStream stream)
Send the given input stream.
|
Result |
sendInputStream(java.io.InputStream stream,
long contentLength)
Send the given input stream.
|
Result |
sendJson(com.fasterxml.jackson.databind.JsonNode json)
Send a json result.
|
Result |
sendJson(com.fasterxml.jackson.databind.JsonNode json,
com.fasterxml.jackson.core.JsonEncoding encoding)
Send a json result.
|
Result |
sendJson(com.fasterxml.jackson.databind.JsonNode json,
java.lang.String charset)
Deprecated.
As of 2.6.0, use sendJson(JsonNode, JsonEncoding)
|
Result |
sendPath(java.nio.file.Path path)
Sends the given path if it is a valid file.
|
Result |
sendPath(java.nio.file.Path path,
boolean inline)
Sends the given path if it is a valid file.
|
Result |
sendPath(java.nio.file.Path path,
boolean inline,
java.lang.String filename)
Sends the given path if it is a valid file.
|
Result |
sendPath(java.nio.file.Path path,
java.lang.String filename)
Sends the given path if it is a valid file.
|
Result |
sendResource(java.lang.String resourceName)
Send the given resource.
|
Result |
sendResource(java.lang.String resourceName,
boolean inline)
Send the given resource.
|
Result |
sendResource(java.lang.String resourceName,
boolean inline,
java.lang.String filename)
Send the given resource.
|
Result |
sendResource(java.lang.String resourceName,
java.lang.ClassLoader classLoader)
Send the given resource from the given classloader.
|
Result |
sendResource(java.lang.String resourceName,
java.lang.ClassLoader classLoader,
boolean inline)
Send the given resource from the given classloader.
|
Result |
sendResource(java.lang.String resourceName,
java.lang.ClassLoader classLoader,
boolean inline,
java.lang.String filename)
Send the given resource from the given classloader.
|
as, asScala, body, charset, contentType, cookie, cookies, discardHeader, flash, getHeader, header, header, headers, reasonPhrase, redirectLocation, session, status, withCookies, withHeader, withHeaders
public Result sendInputStream(java.io.InputStream stream)
stream
- The input stream to send.public Result sendInputStream(java.io.InputStream stream, long contentLength)
stream
- The input stream to send.contentLength
- The length of the content in the stream.public Result sendResource(java.lang.String resourceName)
The resource will be loaded from the same classloader that this class comes from.
resourceName
- The path of the resource to load.public Result sendResource(java.lang.String resourceName, java.lang.ClassLoader classLoader)
resourceName
- The path of the resource to load.classLoader
- The classloader to load it from.public Result sendResource(java.lang.String resourceName, boolean inline)
The resource will be loaded from the same classloader that this class comes from.
resourceName
- The path of the resource to load.inline
- Whether it should be served as an inline file, or as an attachment.public Result sendResource(java.lang.String resourceName, java.lang.ClassLoader classLoader, boolean inline)
resourceName
- The path of the resource to load.classLoader
- The classloader to load it from.inline
- Whether it should be served as an inline file, or as an attachment.public Result sendResource(java.lang.String resourceName, boolean inline, java.lang.String filename)
The resource will be loaded from the same classloader that this class comes from.
resourceName
- The path of the resource to load.inline
- Whether it should be served as an inline file, or as an attachment.filename
- The file name of the resource.public Result sendResource(java.lang.String resourceName, java.lang.ClassLoader classLoader, boolean inline, java.lang.String filename)
resourceName
- The path of the resource to load.classLoader
- The classloader to load it from.inline
- Whether it should be served as an inline file, or as an attachment.filename
- The file name of the resource.public Result sendPath(java.nio.file.Path path)
path
- The path to send.public Result sendPath(java.nio.file.Path path, boolean inline)
path
- The path to send.inline
- Whether it should be served as an inline file, or as an attachment.public Result sendPath(java.nio.file.Path path, java.lang.String filename)
path
- The path to send.filename
- The file name of the path.public Result sendPath(java.nio.file.Path path, boolean inline, java.lang.String filename)
path
- The path to send.inline
- Whether it should be served as an inline file, or as an attachment.filename
- The file name of the path.public Result sendFile(java.io.File file)
file
- The file to send.public Result sendFile(java.io.File file, boolean inline)
file
- The file to send.inline
- True if the file should be sent inline, false if it should be sent as an attachment.public Result sendFile(java.io.File file, java.lang.String fileName)
file
- The file to send.fileName
- The name of the attachmentpublic Result sendFile(java.io.File file, boolean inline, java.lang.String fileName)
file
- The file to send.fileName
- The name of the attachmentinline
- True if the file should be sent inline, false if it should be sent as an attachment.public Result chunked(akka.stream.javadsl.Source<akka.util.ByteString,?> chunks)
chunks
- the chunks to sendpublic Result sendJson(com.fasterxml.jackson.databind.JsonNode json)
json
- the json node to send@Deprecated public Result sendJson(com.fasterxml.jackson.databind.JsonNode json, java.lang.String charset)
json
- the json to sendcharset
- the charset in which to encode the json (e.g. "UTF-8")public Result sendJson(com.fasterxml.jackson.databind.JsonNode json, com.fasterxml.jackson.core.JsonEncoding encoding)
json
- the json to sendencoding
- the encoding in which to encode the json (e.g. "UTF-8")public Result sendEntity(HttpEntity entity)