public class StatusHeader extends Result
Constructor and Description |
---|
StatusHeader(int status) |
Modifier and Type | Method and Description |
---|---|
<T> Result |
chunked(Results.Chunks<T> chunks)
Deprecated.
Use
chunked(Source) instead. |
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,
boolean inline)
Sends the given file.
|
Result |
sendFile(java.io.File file,
java.lang.String fileName)
Send the given file as an attachment.
|
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,
java.lang.String charset)
Send a json result.
|
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 |
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,
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.
|
as, asScala, body, charset, contentType, cookie, cookies, flash, header, header, headers, reasonPhrase, redirectLocation, session, status, 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 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, 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, 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 chunked(akka.stream.javadsl.Source<akka.util.ByteString,?> chunks)
chunks
- the chunks to sendpublic <T> Result chunked(Results.Chunks<T> chunks)
chunked(Source)
instead.T
- Deprecatedchunks
- Deprecatedpublic Result sendJson(com.fasterxml.jackson.databind.JsonNode json)
json
- the json node to sendpublic 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 sendEntity(HttpEntity entity)