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,
FileMimeTypes fileMimeTypes)
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,
boolean inline,
java.lang.String fileName,
FileMimeTypes fileMimeTypes)
Send the given file.
|
Result |
sendFile(java.io.File file,
FileMimeTypes fileMimeTypes)
Sends the given file using the default inline mode.
|
Result |
sendFile(java.io.File file,
java.lang.String fileName)
Send the given file.
|
Result |
sendFile(java.io.File file,
java.lang.String fileName,
FileMimeTypes fileMimeTypes)
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 |
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,
FileMimeTypes fileMimeTypes)
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,
boolean inline,
java.lang.String filename,
FileMimeTypes fileMimeTypes)
Sends the given path if it is a valid file.
|
Result |
sendPath(java.nio.file.Path path,
FileMimeTypes fileMimeTypes)
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 |
sendPath(java.nio.file.Path path,
java.lang.String filename,
FileMimeTypes fileMimeTypes)
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,
FileMimeTypes fileMimeTypes)
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,
boolean inline,
java.lang.String filename,
FileMimeTypes fileMimeTypes)
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,
FileMimeTypes fileMimeTypes)
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.
|
Result |
sendResource(java.lang.String resourceName,
java.lang.ClassLoader classLoader,
boolean inline,
java.lang.String filename,
FileMimeTypes fileMimeTypes)
Send the given resource from the given classloader.
|
Result |
sendResource(java.lang.String resourceName,
java.lang.ClassLoader classLoader,
FileMimeTypes fileMimeTypes)
Send the given resource from the given classloader.
|
Result |
sendResource(java.lang.String resourceName,
FileMimeTypes fileMimeTypes)
Send the given resource.
|
Result |
streamed(akka.stream.javadsl.Source<akka.util.ByteString,?> body,
java.util.Optional<java.lang.Long> contentLength,
java.util.Optional<java.lang.String> contentType)
Send a streamed response with the given source.
|
addingToSession, addingToSession, as, asScala, body, charset, contentType, cookie, cookies, discardingCookie, discardingCookie, discardingCookie, discardingCookie, flash, flashing, flashing, getCookie, getHeader, header, headers, reasonPhrase, redirectLocation, removingFromFlash, removingFromSession, session, session, status, withCookies, withFlash, withFlash, withHeader, withHeaders, withLang, withNewFlash, withNewSession, withoutHeader, withoutLang, withSession, withSession
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, FileMimeTypes fileMimeTypes)
The resource will be loaded from the same classloader that this class comes from.
resourceName
- The path of the resource to load.fileMimeTypes
- Used for file type mapping.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, java.lang.ClassLoader classLoader, FileMimeTypes fileMimeTypes)
resourceName
- The path of the resource to load.classLoader
- The classloader to load it from.fileMimeTypes
- Used for file type mapping.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, boolean inline, FileMimeTypes fileMimeTypes)
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.fileMimeTypes
- Used for file type mapping.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, java.lang.ClassLoader classLoader, boolean inline, FileMimeTypes fileMimeTypes)
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.fileMimeTypes
- Used for file type mapping.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, boolean inline, java.lang.String filename, FileMimeTypes fileMimeTypes)
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.fileMimeTypes
- Used for file type mapping.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 sendResource(java.lang.String resourceName, java.lang.ClassLoader classLoader, boolean inline, java.lang.String filename, FileMimeTypes fileMimeTypes)
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.fileMimeTypes
- Used for file type mapping.public Result sendPath(java.nio.file.Path path)
path
- The path to send.public Result sendPath(java.nio.file.Path path, FileMimeTypes fileMimeTypes)
path
- The path to send.fileMimeTypes
- Used for file type mapping.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, FileMimeTypes fileMimeTypes)
path
- The path to send.inline
- Whether it should be served as an inline file, or as an attachment.fileMimeTypes
- Used for file type mapping.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, java.lang.String filename, FileMimeTypes fileMimeTypes)
path
- The path to send.filename
- The file name of the path.fileMimeTypes
- Used for file type mapping.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 sendPath(java.nio.file.Path path, boolean inline, java.lang.String filename, FileMimeTypes fileMimeTypes)
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.fileMimeTypes
- Used for file type mapping.public Result sendFile(java.io.File file)
file
- The file to send.public Result sendFile(java.io.File file, FileMimeTypes fileMimeTypes)
file
- The file to send.fileMimeTypes
- Used for file type mapping.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, boolean inline, FileMimeTypes fileMimeTypes)
file
- The file to send.inline
- True if the file should be sent inline, false if it should be sent as an attachment.fileMimeTypes
- Used for file type mapping.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, java.lang.String fileName, FileMimeTypes fileMimeTypes)
file
- The file to send.fileName
- The name of the attachmentfileMimeTypes
- Used for file type mapping.public 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 sendFile(java.io.File file, boolean inline, java.lang.String fileName, FileMimeTypes fileMimeTypes)
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.fileMimeTypes
- Used for file type mapping.public Result chunked(akka.stream.javadsl.Source<akka.util.ByteString,?> chunks)
chunks
- the chunks to sendpublic Result streamed(akka.stream.javadsl.Source<akka.util.ByteString,?> body, java.util.Optional<java.lang.Long> contentLength, java.util.Optional<java.lang.String> contentType)
body
- the source to sendcontentLength
- the entity content length.contentType
- the entity content type.public Result sendJson(com.fasterxml.jackson.databind.JsonNode json)
json
- the json node to sendpublic 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)