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 |
chunked(akka.stream.javadsl.Source<akka.util.ByteString,?> chunks,
boolean inline,
Optional<String> fileName)
Send a chunked response with the given chunks.
|
Result |
chunked(akka.stream.javadsl.Source<akka.util.ByteString,?> chunks,
boolean inline,
Optional<String> fileName,
FileMimeTypes fileMimeTypes)
Send a chunked response with the given chunks.
|
Result |
chunked(akka.stream.javadsl.Source<akka.util.ByteString,?> chunks,
Optional<String> contentType)
Send a chunked response with the given chunks.
|
Result |
sendBytes(byte[] content)
Send the given bytes.
|
Result |
sendBytes(byte[] content,
boolean inline,
Optional<String> fileName)
Send the given bytes.
|
Result |
sendBytes(byte[] content,
boolean inline,
Optional<String> fileName,
FileMimeTypes fileMimeTypes)
Send the given bytes.
|
Result |
sendBytes(byte[] content,
Optional<String> contentType)
Send the given bytes.
|
Result |
sendByteString(akka.util.ByteString content)
Send the given ByteString.
|
Result |
sendByteString(akka.util.ByteString content,
boolean inline,
Optional<String> fileName)
Send the given ByteString.
|
Result |
sendByteString(akka.util.ByteString content,
boolean inline,
Optional<String> fileName,
FileMimeTypes fileMimeTypes)
Send the given ByteString.
|
Result |
sendByteString(akka.util.ByteString content,
Optional<String> contentType)
Send the given ByteString.
|
Result |
sendEntity(HttpEntity entity)
Send an HTTP entity.
|
Result |
sendEntity(HttpEntity entity,
boolean inline,
Optional<String> fileName)
Send an HTTP entity.
|
Result |
sendEntity(HttpEntity entity,
boolean inline,
Optional<String> fileName,
FileMimeTypes fileMimeTypes)
Send an HTTP entity.
|
Result |
sendFile(File file)
Sends the given file using the default inline mode.
|
Result |
sendFile(File file,
boolean inline)
Sends the given file.
|
Result |
sendFile(File file,
boolean inline,
FileMimeTypes fileMimeTypes)
Sends the given file.
|
Result |
sendFile(File file,
boolean inline,
FileMimeTypes fileMimeTypes,
Runnable onClose,
Executor executor)
Sends the given file.
|
Result |
sendFile(File file,
boolean inline,
Optional<String> fileName)
Send the given file.
|
Result |
sendFile(File file,
boolean inline,
Optional<String> fileName,
FileMimeTypes fileMimeTypes)
Send the given file.
|
Result |
sendFile(File file,
boolean inline,
Optional<String> fileName,
FileMimeTypes fileMimeTypes,
Runnable onClose,
Executor executor)
Send the given file.
|
Result |
sendFile(File file,
boolean inline,
Optional<String> fileName,
Runnable onClose,
Executor executor)
Send the given file.
|
Result |
sendFile(File file,
boolean inline,
Runnable onClose,
Executor executor)
Sends the given file.
|
Result |
sendFile(File file,
boolean inline,
String fileName)
Deprecated.
Deprecated as of 2.8.0. Use to
sendFile(File, boolean, Optional) . |
Result |
sendFile(File file,
boolean inline,
String fileName,
FileMimeTypes fileMimeTypes)
Deprecated.
Deprecated as of 2.8.0. Use to
sendFile(File, boolean, Optional,
FileMimeTypes) . |
Result |
sendFile(File file,
FileMimeTypes fileMimeTypes)
Sends the given file using the default inline mode.
|
Result |
sendFile(File file,
FileMimeTypes fileMimeTypes,
Runnable onClose,
Executor executor)
Sends the given file using the default inline mode.
|
Result |
sendFile(File file,
Optional<String> fileName)
Send the given file.
|
Result |
sendFile(File file,
Optional<String> fileName,
FileMimeTypes fileMimeTypes)
Send the given file.
|
Result |
sendFile(File file,
Optional<String> fileName,
FileMimeTypes fileMimeTypes,
Runnable onClose,
Executor executor)
Send the given file.
|
Result |
sendFile(File file,
Optional<String> fileName,
Runnable onClose,
Executor executor)
Send the given file.
|
Result |
sendFile(File file,
Runnable onClose,
Executor executor)
Sends the given file using the default inline mode.
|
Result |
sendFile(File file,
String fileName)
Deprecated.
Deprecated as of 2.8.0. Use to
sendFile(File, Optional) . |
Result |
sendFile(File file,
String fileName,
FileMimeTypes fileMimeTypes)
Deprecated.
Deprecated as of 2.8.0. Use to
sendFile(File, Optional, FileMimeTypes) . |
Result |
sendInputStream(InputStream stream)
Send the given input stream.
|
Result |
sendInputStream(InputStream stream,
long contentLength)
Send the given input stream.
|
Result |
sendInputStream(InputStream stream,
long contentLength,
Optional<String> contentType)
Send the given input stream.
|
Result |
sendInputStream(InputStream stream,
long contentLength,
Optional<String> contentType,
Runnable onClose,
Executor executor)
Send the given input stream.
|
Result |
sendInputStream(InputStream stream,
long contentLength,
Runnable onClose,
Executor executor)
Send the given input stream.
|
Result |
sendInputStream(InputStream stream,
Optional<String> contentType)
Send the given input stream.
|
Result |
sendInputStream(InputStream stream,
Optional<String> contentType,
Runnable onClose,
Executor executor)
Send the given input stream.
|
Result |
sendInputStream(InputStream stream,
Runnable onClose,
Executor executor)
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,
boolean inline,
Optional<String> fileName)
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,
com.fasterxml.jackson.core.JsonEncoding encoding,
boolean inline,
Optional<String> fileName)
Send a json result.
|
Result |
sendPath(Path path)
Sends the given path if it is a valid file.
|
Result |
sendPath(Path path,
boolean inline)
Sends the given path if it is a valid file.
|
Result |
sendPath(Path path,
boolean inline,
FileMimeTypes fileMimeTypes)
Sends the given path if it is a valid file.
|
Result |
sendPath(Path path,
boolean inline,
FileMimeTypes fileMimeTypes,
Runnable onClose,
Executor executor)
Sends the given path if it is a valid file.
|
Result |
sendPath(Path path,
boolean inline,
Optional<String> filename)
Sends the given path if it is a valid file.
|
Result |
sendPath(Path path,
boolean inline,
Optional<String> filename,
FileMimeTypes fileMimeTypes)
Sends the given path if it is a valid file.
|
Result |
sendPath(Path path,
boolean inline,
Optional<String> filename,
FileMimeTypes fileMimeTypes,
Runnable onClose,
Executor executor)
Sends the given path if it is a valid file.
|
Result |
sendPath(Path path,
boolean inline,
Optional<String> filename,
Runnable onClose,
Executor executor)
Sends the given path if it is a valid file.
|
Result |
sendPath(Path path,
boolean inline,
Runnable onClose,
Executor executor)
Sends the given path if it is a valid file.
|
Result |
sendPath(Path path,
boolean inline,
String filename)
Deprecated.
Deprecated as of 2.8.0. Use to
sendPath(Path, boolean, Optional) . |
Result |
sendPath(Path path,
boolean inline,
String filename,
FileMimeTypes fileMimeTypes)
Deprecated.
Deprecated as of 2.8.0. Use to
sendPath(Path, boolean, Optional,
FileMimeTypes) . |
Result |
sendPath(Path path,
FileMimeTypes fileMimeTypes)
Sends the given path if it is a valid file.
|
Result |
sendPath(Path path,
FileMimeTypes fileMimeTypes,
Runnable onClose,
Executor executor)
Sends the given path if it is a valid file.
|
Result |
sendPath(Path path,
Optional<String> filename)
Sends the given path if it is a valid file.
|
Result |
sendPath(Path path,
Optional<String> filename,
FileMimeTypes fileMimeTypes)
Sends the given path if it is a valid file.
|
Result |
sendPath(Path path,
Optional<String> filename,
FileMimeTypes fileMimeTypes,
Runnable onClose,
Executor executor)
Sends the given path if it is a valid file.
|
Result |
sendPath(Path path,
Optional<String> filename,
Runnable onClose,
Executor executor)
Sends the given path if it is a valid file.
|
Result |
sendPath(Path path,
Runnable onClose,
Executor executor)
Sends the given path if it is a valid file.
|
Result |
sendPath(Path path,
String filename)
Deprecated.
Deprecated as of 2.8.0. Use to
sendPath(Path, Optional) . |
Result |
sendPath(Path path,
String filename,
FileMimeTypes fileMimeTypes)
Deprecated.
Deprecated as of 2.8.0. Use to
sendPath(Path, Optional, FileMimeTypes) . |
Result |
sendResource(String resourceName)
Send the given resource.
|
Result |
sendResource(String resourceName,
boolean inline)
Send the given resource.
|
Result |
sendResource(String resourceName,
boolean inline,
FileMimeTypes fileMimeTypes)
Send the given resource.
|
Result |
sendResource(String resourceName,
boolean inline,
FileMimeTypes fileMimeTypes,
Runnable onClose,
Executor executor)
Send the given resource.
|
Result |
sendResource(String resourceName,
boolean inline,
Optional<String> filename)
Send the given resource.
|
Result |
sendResource(String resourceName,
boolean inline,
Optional<String> filename,
FileMimeTypes fileMimeTypes)
Send the given resource.
|
Result |
sendResource(String resourceName,
boolean inline,
Optional<String> filename,
FileMimeTypes fileMimeTypes,
Runnable onClose,
Executor executor)
Send the given resource.
|
Result |
sendResource(String resourceName,
boolean inline,
Optional<String> filename,
Runnable onClose,
Executor executor)
Send the given resource.
|
Result |
sendResource(String resourceName,
boolean inline,
Runnable onClose,
Executor executor)
Send the given resource.
|
Result |
sendResource(String resourceName,
boolean inline,
String filename)
Deprecated.
Deprecated as of 2.8.0. Use
sendResource(String,boolean,Optional) . |
Result |
sendResource(String resourceName,
boolean inline,
String filename,
FileMimeTypes fileMimeTypes)
Deprecated.
Deprecated as of 2.8.0. Use to
sendResource(String, boolean, Optional,
FileMimeTypes) . |
Result |
sendResource(String resourceName,
ClassLoader classLoader)
Send the given resource from the given classloader.
|
Result |
sendResource(String resourceName,
ClassLoader classLoader,
boolean inline)
Send the given resource from the given classloader.
|
Result |
sendResource(String resourceName,
ClassLoader classLoader,
boolean inline,
FileMimeTypes fileMimeTypes)
Send the given resource from the given classloader.
|
Result |
sendResource(String resourceName,
ClassLoader classLoader,
boolean inline,
FileMimeTypes fileMimeTypes,
Runnable onClose,
Executor executor)
Send the given resource from the given classloader.
|
Result |
sendResource(String resourceName,
ClassLoader classLoader,
boolean inline,
Optional<String> filename)
Send the given resource from the given classloader.
|
Result |
sendResource(String resourceName,
ClassLoader classLoader,
boolean inline,
Optional<String> filename,
FileMimeTypes fileMimeTypes)
Send the given resource from the given classloader.
|
Result |
sendResource(String resourceName,
ClassLoader classLoader,
boolean inline,
Optional<String> filename,
FileMimeTypes fileMimeTypes,
Runnable onClose,
Executor executor)
Send the given resource from the given classloader.
|
Result |
sendResource(String resourceName,
ClassLoader classLoader,
boolean inline,
Optional<String> filename,
Runnable onClose,
Executor executor)
Send the given resource from the given classloader.
|
Result |
sendResource(String resourceName,
ClassLoader classLoader,
boolean inline,
Runnable onClose,
Executor executor)
Send the given resource from the given classloader.
|
Result |
sendResource(String resourceName,
ClassLoader classLoader,
boolean inline,
String filename)
Deprecated.
Deprecated as of 2.8.0. Use to
sendResource(String, ClassLoader, boolean,
Optional) . |
Result |
sendResource(String resourceName,
ClassLoader classLoader,
boolean inline,
String filename,
FileMimeTypes fileMimeTypes)
Deprecated.
Deprecated as of 2.8.0. Use to
sendResource(String, ClassLoader, boolean,
Optional, FileMimeTypes) . |
Result |
sendResource(String resourceName,
ClassLoader classLoader,
FileMimeTypes fileMimeTypes)
Send the given resource from the given classloader.
|
Result |
sendResource(String resourceName,
ClassLoader classLoader,
FileMimeTypes fileMimeTypes,
Runnable onClose,
Executor executor)
Send the given resource from the given classloader.
|
Result |
sendResource(String resourceName,
ClassLoader classLoader,
Optional<String> fileName)
Send the given resource from the given classloader.
|
Result |
sendResource(String resourceName,
ClassLoader classLoader,
Optional<String> fileName,
FileMimeTypes fileMimeTypes)
Send the given resource from the given classloader.
|
Result |
sendResource(String resourceName,
ClassLoader classLoader,
Optional<String> fileName,
FileMimeTypes fileMimeTypes,
Runnable onClose,
Executor executor)
Send the given resource from the given classloader.
|
Result |
sendResource(String resourceName,
ClassLoader classLoader,
Optional<String> fileName,
Runnable onClose,
Executor executor)
Send the given resource from the given classloader.
|
Result |
sendResource(String resourceName,
ClassLoader classLoader,
Runnable onClose,
Executor executor)
Send the given resource from the given classloader.
|
Result |
sendResource(String resourceName,
FileMimeTypes fileMimeTypes)
Send the given resource.
|
Result |
sendResource(String resourceName,
FileMimeTypes fileMimeTypes,
Runnable onClose,
Executor executor)
Send the given resource.
|
Result |
sendResource(String resourceName,
Optional<String> fileName)
Send the given resource.
|
Result |
sendResource(String resourceName,
Optional<String> fileName,
FileMimeTypes fileMimeTypes)
Send the given resource.
|
Result |
sendResource(String resourceName,
Optional<String> fileName,
FileMimeTypes fileMimeTypes,
Runnable onClose,
Executor executor)
Send the given resource.
|
Result |
sendResource(String resourceName,
Optional<String> fileName,
Runnable onClose,
Executor executor)
Send the given resource.
|
Result |
sendResource(String resourceName,
Runnable onClose,
Executor executor)
Send the given resource.
|
Result |
streamed(akka.stream.javadsl.Source<akka.util.ByteString,?> body,
Optional<Long> contentLength)
Send a streamed response with the given source.
|
Result |
streamed(akka.stream.javadsl.Source<akka.util.ByteString,?> body,
Optional<Long> contentLength,
boolean inline,
Optional<String> fileName)
Send a streamed response with the given source.
|
Result |
streamed(akka.stream.javadsl.Source<akka.util.ByteString,?> body,
Optional<Long> contentLength,
boolean inline,
Optional<String> fileName,
FileMimeTypes fileMimeTypes)
Send a streamed response with the given source.
|
Result |
streamed(akka.stream.javadsl.Source<akka.util.ByteString,?> body,
Optional<Long> contentLength,
Optional<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, withLang, withNewFlash, withNewSession, withoutHeader, withoutLang, withSession, withSession
public Result sendInputStream(InputStream stream)
The input stream will be sent chunked since there is no specified content length.
stream
- The input stream to send.public Result sendInputStream(InputStream stream, Runnable onClose, Executor executor)
The input stream will be sent chunked since there is no specified content length.
stream
- The input stream to send.onClose
- Useful in order to perform cleanup operations (e.g. deleting a temporary file
generated for a download).executor
- The executor to use for asynchronous execution of onClose
.public Result sendInputStream(InputStream stream, Optional<String> contentType)
The input stream will be sent chunked since there is no specified content length.
stream
- The input stream to send.contentType
- the entity content type.public Result sendInputStream(InputStream stream, Optional<String> contentType, Runnable onClose, Executor executor)
The input stream will be sent chunked since there is no specified content length.
stream
- The input stream to send.contentType
- the entity content type.onClose
- Useful in order to perform cleanup operations (e.g. deleting a temporary file
generated for a download).executor
- The executor to use for asynchronous execution of onClose
.public Result sendInputStream(InputStream stream, long contentLength)
stream
- The input stream to send.contentLength
- The length of the content in the stream.public Result sendInputStream(InputStream stream, long contentLength, Runnable onClose, Executor executor)
stream
- The input stream to send.contentLength
- The length of the content in the stream.onClose
- Useful in order to perform cleanup operations (e.g. deleting a temporary file
generated for a download).executor
- The executor to use for asynchronous execution of onClose
.public Result sendInputStream(InputStream stream, long contentLength, Optional<String> contentType)
stream
- The input stream to send.contentLength
- The length of the content in the stream.contentType
- the entity content type.public Result sendInputStream(InputStream stream, long contentLength, Optional<String> contentType, Runnable onClose, Executor executor)
stream
- The input stream to send.contentLength
- The length of the content in the stream.contentType
- the entity content type.onClose
- Useful in order to perform cleanup operations (e.g. deleting a temporary file
generated for a download).executor
- The executor to use for asynchronous execution of onClose
.public Result sendBytes(byte[] content)
content
- The bytes to send.public Result sendBytes(byte[] content, Optional<String> contentType)
content
- The bytes to send.contentType
- the entity content type.public Result sendBytes(byte[] content, boolean inline, Optional<String> fileName)
content
- The bytes to send.inline
- Whether it should be served as an inline file, or as an attachment.fileName
- The file name rendered in the Content-Disposition
header. The response
will also automatically include the MIME type in the Content-Type
header deducing
it from this file name or fallback to application/octet-stream
if unknown.public Result sendBytes(byte[] content, boolean inline, Optional<String> fileName, FileMimeTypes fileMimeTypes)
content
- The bytes to send.inline
- Whether it should be served as an inline file, or as an attachment.fileName
- The file name rendered in the Content-Disposition
header. The response
will also automatically include the MIME type in the Content-Type
header deducing
it from this file name if fileMimeTypes
includes it or fallback to application/octet-stream
if unknown.fileMimeTypes
- Used for file type mapping.public Result sendByteString(akka.util.ByteString content)
content
- The ByteString to send.public Result sendByteString(akka.util.ByteString content, Optional<String> contentType)
content
- The ByteString to send.contentType
- the entity content type.public Result sendByteString(akka.util.ByteString content, boolean inline, Optional<String> fileName)
content
- The ByteString to send.inline
- Whether it should be served as an inline file, or as an attachment.fileName
- The file name rendered in the Content-Disposition
header. The response
will also automatically include the MIME type in the Content-Type
header deducing
it from this file name or fallback to application/octet-stream
if unknown.public Result sendByteString(akka.util.ByteString content, boolean inline, Optional<String> fileName, FileMimeTypes fileMimeTypes)
content
- The ByteString to send.inline
- Whether it should be served as an inline file, or as an attachment.fileName
- The file name rendered in the Content-Disposition
header. The response
will also automatically include the MIME type in the Content-Type
header deducing
it from this file name if fileMimeTypes
includes it or fallback to application/octet-stream
if unknown.fileMimeTypes
- Used for file type mapping.public Result sendResource(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(String resourceName, Runnable onClose, Executor executor)
The resource will be loaded from the same classloader that this class comes from.
resourceName
- The path of the resource to load.onClose
- Useful in order to perform cleanup operations (e.g. deleting a temporary file
generated for a download).executor
- The executor to use for asynchronous execution of onClose
.public Result sendResource(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(String resourceName, FileMimeTypes fileMimeTypes, Runnable onClose, Executor executor)
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.onClose
- Useful in order to perform cleanup operations (e.g. deleting a temporary file
generated for a download).executor
- The executor to use for asynchronous execution of onClose
.public Result sendResource(String resourceName, ClassLoader classLoader)
resourceName
- The path of the resource to load.classLoader
- The classloader to load it from.public Result sendResource(String resourceName, ClassLoader classLoader, Runnable onClose, Executor executor)
resourceName
- The path of the resource to load.classLoader
- The classloader to load it from.onClose
- Useful in order to perform cleanup operations (e.g. deleting a temporary file
generated for a download).executor
- The executor to use for asynchronous execution of onClose
.public Result sendResource(String resourceName, ClassLoader classLoader, Optional<String> fileName)
resourceName
- The path of the resource to load.classLoader
- The classloader to load it from.fileName
- The file name rendered in the Content-Disposition
header. The response
will also automatically include the MIME type in the Content-Type
header deducing
it from this file name or fallback to application/octet-stream
if unknown.public Result sendResource(String resourceName, ClassLoader classLoader, Optional<String> fileName, Runnable onClose, Executor executor)
resourceName
- The path of the resource to load.classLoader
- The classloader to load it from.fileName
- The file name rendered in the Content-Disposition
header. The response
will also automatically include the MIME type in the Content-Type
header deducing
it from this file name or fallback to application/octet-stream
if unknown.onClose
- Useful in order to perform cleanup operations (e.g. deleting a temporary file
generated for a download).executor
- The executor to use for asynchronous execution of onClose
.public Result sendResource(String resourceName, ClassLoader classLoader, Optional<String> fileName, FileMimeTypes fileMimeTypes)
resourceName
- The path of the resource to load.classLoader
- The classloader to load it from.fileName
- The file name rendered in the Content-Disposition
header. The response
will also automatically include the MIME type in the Content-Type
header deducing
it from this file name if fileMimeTypes
includes it or fallback to application/octet-stream
if unknown.fileMimeTypes
- Used for file type mapping.public Result sendResource(String resourceName, ClassLoader classLoader, Optional<String> fileName, FileMimeTypes fileMimeTypes, Runnable onClose, Executor executor)
resourceName
- The path of the resource to load.classLoader
- The classloader to load it from.fileName
- The file name rendered in the Content-Disposition
header. The response
will also automatically include the MIME type in the Content-Type
header deducing
it from this file name if fileMimeTypes
includes it or fallback to application/octet-stream
if unknown.fileMimeTypes
- Used for file type mapping.onClose
- Useful in order to perform cleanup operations (e.g. deleting a temporary file
generated for a download).executor
- The executor to use for asynchronous execution of onClose
.public Result sendResource(String resourceName, 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(String resourceName, ClassLoader classLoader, FileMimeTypes fileMimeTypes, Runnable onClose, Executor executor)
resourceName
- The path of the resource to load.classLoader
- The classloader to load it from.fileMimeTypes
- Used for file type mapping.onClose
- Useful in order to perform cleanup operations (e.g. deleting a temporary file
generated for a download).executor
- The executor to use for asynchronous execution of onClose
.public Result sendResource(String resourceName, Optional<String> fileName)
The resource will be loaded from the same classloader that this class comes from.
resourceName
- The path of the resource to load.fileName
- The file name rendered in the Content-Disposition
header. The response
will also automatically include the MIME type in the Content-Type
header deducing
it from this file name or fallback to application/octet-stream
if unknown.public Result sendResource(String resourceName, Optional<String> fileName, Runnable onClose, Executor executor)
The resource will be loaded from the same classloader that this class comes from.
resourceName
- The path of the resource to load.fileName
- The file name rendered in the Content-Disposition
header. The response
will also automatically include the MIME type in the Content-Type
header deducing
it from this file name or fallback to application/octet-stream
if unknown.onClose
- Useful in order to perform cleanup operations (e.g. deleting a temporary file
generated for a download).executor
- The executor to use for asynchronous execution of onClose
.public Result sendResource(String resourceName, Optional<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.fileName
- The file name rendered in the Content-Disposition
header. The response
will also automatically include the MIME type in the Content-Type
header deducing
it from this file name if fileMimeTypes
includes it or fallback to application/octet-stream
if unknown.fileMimeTypes
- Used for file type mapping.public Result sendResource(String resourceName, Optional<String> fileName, FileMimeTypes fileMimeTypes, Runnable onClose, Executor executor)
The resource will be loaded from the same classloader that this class comes from.
resourceName
- The path of the resource to load.fileName
- The file name rendered in the Content-Disposition
header. The response
will also automatically include the MIME type in the Content-Type
header deducing
it from this file name if fileMimeTypes
includes it or fallback to application/octet-stream
if unknown.fileMimeTypes
- Used for file type mapping.onClose
- Useful in order to perform cleanup operations (e.g. deleting a temporary file
generated for a download).executor
- The executor to use for asynchronous execution of onClose
.public Result sendResource(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(String resourceName, boolean inline, Runnable onClose, Executor executor)
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.onClose
- Useful in order to perform cleanup operations (e.g. deleting a temporary file
generated for a download).executor
- The executor to use for asynchronous execution of onClose
.public Result sendResource(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(String resourceName, boolean inline, FileMimeTypes fileMimeTypes, Runnable onClose, Executor executor)
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.onClose
- Useful in order to perform cleanup operations (e.g. deleting a temporary file
generated for a download).executor
- The executor to use for asynchronous execution of onClose
.public Result sendResource(String resourceName, 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(String resourceName, ClassLoader classLoader, boolean inline, Runnable onClose, Executor executor)
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.onClose
- Useful in order to perform cleanup operations (e.g. deleting a temporary file
generated for a download).executor
- The executor to use for asynchronous execution of onClose
.public Result sendResource(String resourceName, 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(String resourceName, ClassLoader classLoader, boolean inline, FileMimeTypes fileMimeTypes, Runnable onClose, Executor executor)
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.onClose
- Useful in order to perform cleanup operations (e.g. deleting a temporary file
generated for a download).executor
- The executor to use for asynchronous execution of onClose
.@Deprecated public Result sendResource(String resourceName, boolean inline, String filename)
sendResource(String,boolean,Optional)
.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 rendered in the Content-Disposition
header. The response
will also automatically include the MIME type in the Content-Type
header deducing
it from this file name or fallback to application/octet-stream
if unknown.public Result sendResource(String resourceName, boolean inline, Optional<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 rendered in the Content-Disposition
header. The response
will also automatically include the MIME type in the Content-Type
header deducing
it from this file name or fallback to application/octet-stream
if unknown.public Result sendResource(String resourceName, boolean inline, Optional<String> filename, Runnable onClose, Executor executor)
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 rendered in the Content-Disposition
header. The response
will also automatically include the MIME type in the Content-Type
header deducing
it from this file name or fallback to application/octet-stream
if unknown.onClose
- Useful in order to perform cleanup operations (e.g. deleting a temporary file
generated for a download).executor
- The executor to use for asynchronous execution of onClose
.@Deprecated public Result sendResource(String resourceName, boolean inline, String filename, FileMimeTypes fileMimeTypes)
sendResource(String, boolean, Optional,
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 rendered in the Content-Disposition
header. The response
will also automatically include the MIME type in the Content-Type
header deducing
it from this file name if fileMimeTypes
includes it or fallback to application/octet-stream
if unknown.fileMimeTypes
- Used for file type mapping.public Result sendResource(String resourceName, boolean inline, Optional<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 rendered in the Content-Disposition
header. The response
will also automatically include the MIME type in the Content-Type
header deducing
it from this file name if fileMimeTypes
includes it or fallback to application/octet-stream
if unknown.fileMimeTypes
- Used for file type mapping.public Result sendResource(String resourceName, boolean inline, Optional<String> filename, FileMimeTypes fileMimeTypes, Runnable onClose, Executor executor)
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 rendered in the Content-Disposition
header. The response
will also automatically include the MIME type in the Content-Type
header deducing
it from this file name if fileMimeTypes
includes it or fallback to application/octet-stream
if unknown.fileMimeTypes
- Used for file type mapping.onClose
- Useful in order to perform cleanup operations (e.g. deleting a temporary file
generated for a download).executor
- The executor to use for asynchronous execution of onClose
.@Deprecated public Result sendResource(String resourceName, ClassLoader classLoader, boolean inline, String filename)
sendResource(String, ClassLoader, boolean,
Optional)
.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 rendered in the Content-Disposition
header. The response
will also automatically include the MIME type in the Content-Type
header deducing
it from this file name or fallback to application/octet-stream
if unknown.public Result sendResource(String resourceName, ClassLoader classLoader, boolean inline, Optional<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 rendered in the Content-Disposition
header. The response
will also automatically include the MIME type in the Content-Type
header deducing
it from this file name or fallback to application/octet-stream
if unknown.public Result sendResource(String resourceName, ClassLoader classLoader, boolean inline, Optional<String> filename, Runnable onClose, Executor executor)
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 rendered in the Content-Disposition
header. The response
will also automatically include the MIME type in the Content-Type
header deducing
it from this file name or fallback to application/octet-stream
if unknown.onClose
- Useful in order to perform cleanup operations (e.g. deleting a temporary file
generated for a download).executor
- The executor to use for asynchronous execution of onClose
.@Deprecated public Result sendResource(String resourceName, ClassLoader classLoader, boolean inline, String filename, FileMimeTypes fileMimeTypes)
sendResource(String, ClassLoader, boolean,
Optional, 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 rendered in the Content-Disposition
header. The response
will also automatically include the MIME type in the Content-Type
header deducing
it from this file name if fileMimeTypes
includes it or fallback to application/octet-stream
if unknown.fileMimeTypes
- Used for file type mapping.public Result sendResource(String resourceName, ClassLoader classLoader, boolean inline, Optional<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 rendered in the Content-Disposition
header. The response
will also automatically include the MIME type in the Content-Type
header deducing
it from this file name if fileMimeTypes
includes it or fallback to application/octet-stream
if unknown.fileMimeTypes
- Used for file type mapping.public Result sendResource(String resourceName, ClassLoader classLoader, boolean inline, Optional<String> filename, FileMimeTypes fileMimeTypes, Runnable onClose, Executor executor)
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 rendered in the Content-Disposition
header. The response
will also automatically include the MIME type in the Content-Type
header deducing
it from this file name if fileMimeTypes
includes it or fallback to application/octet-stream
if unknown.fileMimeTypes
- Used for file type mapping.onClose
- Useful in order to perform cleanup operations (e.g. deleting a temporary file
generated for a download).executor
- The executor to use for asynchronous execution of onClose
.public Result sendPath(Path path)
path
- The path to send.public Result sendPath(Path path, Runnable onClose, Executor executor)
path
- The path to send.onClose
- Useful in order to perform cleanup operations (e.g. deleting a temporary file
generated for a download).executor
- The executor to use for asynchronous execution of onClose
.public Result sendPath(Path path, FileMimeTypes fileMimeTypes)
path
- The path to send.fileMimeTypes
- Used for file type mapping.public Result sendPath(Path path, FileMimeTypes fileMimeTypes, Runnable onClose, Executor executor)
path
- The path to send.fileMimeTypes
- Used for file type mapping.onClose
- Useful in order to perform cleanup operations (e.g. deleting a temporary file
generated for a download).executor
- The executor to use for asynchronous execution of onClose
.public Result sendPath(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(Path path, boolean inline, Runnable onClose, Executor executor)
path
- The path to send.inline
- Whether it should be served as an inline file, or as an attachment.onClose
- Useful in order to perform cleanup operations (e.g. deleting a temporary file
generated for a download).executor
- The executor to use for asynchronous execution of onClose
.public Result sendPath(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(Path path, boolean inline, FileMimeTypes fileMimeTypes, Runnable onClose, Executor executor)
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.onClose
- Useful in order to perform cleanup operations (e.g. deleting a temporary file
generated for a download).executor
- The executor to use for asynchronous execution of onClose
.@Deprecated public Result sendPath(Path path, String filename)
sendPath(Path, Optional)
.path
- The path to send.filename
- The file name rendered in the Content-Disposition
header. The response
will also automatically include the MIME type in the Content-Type
header deducing
it from this file name or fallback to application/octet-stream
if unknown.public Result sendPath(Path path, Optional<String> filename)
path
- The path to send.filename
- The file name rendered in the Content-Disposition
header. The response
will also automatically include the MIME type in the Content-Type
header deducing
it from this file name or fallback to application/octet-stream
if unknown.public Result sendPath(Path path, Optional<String> filename, Runnable onClose, Executor executor)
path
- The path to send.filename
- The file name rendered in the Content-Disposition
header. The response
will also automatically include the MIME type in the Content-Type
header deducing
it from this file name or fallback to application/octet-stream
if unknown.onClose
- Useful in order to perform cleanup operations (e.g. deleting a temporary file
generated for a download).executor
- The executor to use for asynchronous execution of onClose
.@Deprecated public Result sendPath(Path path, String filename, FileMimeTypes fileMimeTypes)
sendPath(Path, Optional, FileMimeTypes)
.path
- The path to send.filename
- The file name rendered in the Content-Disposition
header. The response
will also automatically include the MIME type in the Content-Type
header deducing
it from this file name if fileMimeTypes
includes it or fallback to application/octet-stream
if unknown.fileMimeTypes
- Used for file type mapping.public Result sendPath(Path path, Optional<String> filename, FileMimeTypes fileMimeTypes)
path
- The path to send.filename
- The file name rendered in the Content-Disposition
header. The response
will also automatically include the MIME type in the Content-Type
header deducing
it from this file name if fileMimeTypes
includes it or fallback to application/octet-stream
if unknown.fileMimeTypes
- Used for file type mapping.public Result sendPath(Path path, Optional<String> filename, FileMimeTypes fileMimeTypes, Runnable onClose, Executor executor)
path
- The path to send.filename
- The file name rendered in the Content-Disposition
header. The response
will also automatically include the MIME type in the Content-Type
header deducing
it from this file name if fileMimeTypes
includes it or fallback to application/octet-stream
if unknown.fileMimeTypes
- Used for file type mapping.onClose
- Useful in order to perform cleanup operations (e.g. deleting a temporary file
generated for a download).executor
- The executor to use for asynchronous execution of onClose
.@Deprecated public Result sendPath(Path path, boolean inline, String filename)
sendPath(Path, boolean, Optional)
.path
- The path to send.inline
- Whether it should be served as an inline file, or as an attachment.filename
- The file name rendered in the Content-Disposition
header. The response
will also automatically include the MIME type in the Content-Type
header deducing
it from this file name or fallback to application/octet-stream
if unknown.public Result sendPath(Path path, boolean inline, Optional<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 rendered in the Content-Disposition
header. The response
will also automatically include the MIME type in the Content-Type
header deducing
it from this file name or fallback to application/octet-stream
if unknown.public Result sendPath(Path path, boolean inline, Optional<String> filename, Runnable onClose, Executor executor)
path
- The path to send.inline
- Whether it should be served as an inline file, or as an attachment.filename
- The file name rendered in the Content-Disposition
header. The response
will also automatically include the MIME type in the Content-Type
header deducing
it from this file name or fallback to application/octet-stream
if unknown.onClose
- Useful in order to perform cleanup operations (e.g. deleting a temporary file
generated for a download).executor
- The executor to use for asynchronous execution of onClose
.@Deprecated public Result sendPath(Path path, boolean inline, String filename, FileMimeTypes fileMimeTypes)
sendPath(Path, boolean, Optional,
FileMimeTypes)
.path
- The path to send.inline
- Whether it should be served as an inline file, or as an attachment.filename
- The file name rendered in the Content-Disposition
header. The response
will also automatically include the MIME type in the Content-Type
header deducing
it from this file name if fileMimeTypes
includes it or fallback to application/octet-stream
if unknown.fileMimeTypes
- Used for file type mapping.public Result sendPath(Path path, boolean inline, Optional<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 rendered in the Content-Disposition
header. The response
will also automatically include the MIME type in the Content-Type
header deducing
it from this file name if fileMimeTypes
includes it or fallback to application/octet-stream
if unknown.fileMimeTypes
- Used for file type mapping.public Result sendPath(Path path, boolean inline, Optional<String> filename, FileMimeTypes fileMimeTypes, Runnable onClose, Executor executor)
path
- The path to send.inline
- Whether it should be served as an inline file, or as an attachment.filename
- The file name rendered in the Content-Disposition
header. The response
will also automatically include the MIME type in the Content-Type
header deducing
it from this file name if fileMimeTypes
includes it or fallback to application/octet-stream
if unknown.fileMimeTypes
- Used for file type mapping.onClose
- Useful in order to perform cleanup operations (e.g. deleting a temporary file
generated for a download).executor
- The executor to use for asynchronous execution of onClose
.public Result sendFile(File file)
file
- The file to send.public Result sendFile(File file, Runnable onClose, Executor executor)
file
- The file to send.onClose
- Useful in order to perform cleanup operations (e.g. deleting a temporary file
generated for a download).executor
- The executor to use for asynchronous execution of onClose
.public Result sendFile(File file, FileMimeTypes fileMimeTypes)
file
- The file to send.fileMimeTypes
- Used for file type mapping.public Result sendFile(File file, FileMimeTypes fileMimeTypes, Runnable onClose, Executor executor)
file
- The file to send.fileMimeTypes
- Used for file type mapping.onClose
- Useful in order to perform cleanup operations (e.g. deleting a temporary file
generated for a download).executor
- The executor to use for asynchronous execution of onClose
.public Result sendFile(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(File file, boolean inline, Runnable onClose, Executor executor)
file
- The file to send.inline
- True if the file should be sent inline, false if it should be sent as an
attachment.onClose
- Useful in order to perform cleanup operations (e.g. deleting a temporary file
generated for a download).executor
- The executor to use for asynchronous execution of onClose
.public Result sendFile(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(File file, boolean inline, FileMimeTypes fileMimeTypes, Runnable onClose, Executor executor)
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.onClose
- Useful in order to perform cleanup operations (e.g. deleting a temporary file
generated for a download).executor
- The executor to use for asynchronous execution of onClose
.@Deprecated public Result sendFile(File file, String fileName)
sendFile(File, Optional)
.file
- The file to send.fileName
- The file name rendered in the Content-Disposition
header. The response
will also automatically include the MIME type in the Content-Type
header deducing
it from this file name or fallback to application/octet-stream
if unknown.public Result sendFile(File file, Optional<String> fileName)
file
- The file to send.fileName
- The file name rendered in the Content-Disposition
header. The response
will also automatically include the MIME type in the Content-Type
header deducing
it from this file name or fallback to application/octet-stream
if unknown.public Result sendFile(File file, Optional<String> fileName, Runnable onClose, Executor executor)
file
- The file to send.fileName
- The file name rendered in the Content-Disposition
header. The response
will also automatically include the MIME type in the Content-Type
header deducing
it from this file name or fallback to application/octet-stream
if unknown.onClose
- Useful in order to perform cleanup operations (e.g. deleting a temporary file
generated for a download).executor
- The executor to use for asynchronous execution of onClose
.@Deprecated public Result sendFile(File file, String fileName, FileMimeTypes fileMimeTypes)
sendFile(File, Optional, FileMimeTypes)
.file
- The file to send.fileName
- The file name rendered in the Content-Disposition
header. The response
will also automatically include the MIME type in the Content-Type
header deducing
it from this file name if fileMimeTypes
includes it or fallback to application/octet-stream
if unknown.fileMimeTypes
- Used for file type mapping.public Result sendFile(File file, Optional<String> fileName, FileMimeTypes fileMimeTypes)
file
- The file to send.fileName
- The file name rendered in the Content-Disposition
header. The response
will also automatically include the MIME type in the Content-Type
header deducing
it from this file name if fileMimeTypes
includes it or fallback to application/octet-stream
if unknown.fileMimeTypes
- Used for file type mapping.public Result sendFile(File file, Optional<String> fileName, FileMimeTypes fileMimeTypes, Runnable onClose, Executor executor)
file
- The file to send.fileName
- The file name rendered in the Content-Disposition
header. The response
will also automatically include the MIME type in the Content-Type
header deducing
it from this file name if fileMimeTypes
includes it or fallback to application/octet-stream
if unknown.fileMimeTypes
- Used for file type mapping.onClose
- Useful in order to perform cleanup operations (e.g. deleting a temporary file
generated for a download).executor
- The executor to use for asynchronous execution of onClose
.@Deprecated public Result sendFile(File file, boolean inline, String fileName)
sendFile(File, boolean, Optional)
.file
- The file to send.fileName
- The file name rendered in the Content-Disposition
header. The response
will also automatically include the MIME type in the Content-Type
header deducing
it from this file name or fallback to application/octet-stream
if unknown.inline
- True if the file should be sent inline, false if it should be sent as an
attachment.public Result sendFile(File file, boolean inline, Optional<String> fileName)
file
- The file to send.fileName
- The file name rendered in the Content-Disposition
header. The response
will also automatically include the MIME type in the Content-Type
header deducing
it from this file name or fallback to application/octet-stream
if unknown.inline
- True if the file should be sent inline, false if it should be sent as an
attachment.public Result sendFile(File file, boolean inline, Optional<String> fileName, Runnable onClose, Executor executor)
file
- The file to send.fileName
- The file name rendered in the Content-Disposition
header. The response
will also automatically include the MIME type in the Content-Type
header deducing
it from this file name or fallback to application/octet-stream
if unknown.inline
- True if the file should be sent inline, false if it should be sent as an
attachment.onClose
- Useful in order to perform cleanup operations (e.g. deleting a temporary file
generated for a download).executor
- The executor to use for asynchronous execution of onClose
.@Deprecated public Result sendFile(File file, boolean inline, String fileName, FileMimeTypes fileMimeTypes)
sendFile(File, boolean, Optional,
FileMimeTypes)
.file
- The file to send.fileName
- The file name rendered in the Content-Disposition
header. The response
will also automatically include the MIME type in the Content-Type
header deducing
it from this file name if fileMimeTypes
includes it or fallback to application/octet-stream
if unknown.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(File file, boolean inline, Optional<String> fileName, FileMimeTypes fileMimeTypes)
file
- The file to send.fileName
- The file name rendered in the Content-Disposition
header. The response
will also automatically include the MIME type in the Content-Type
header deducing
it from this file name if fileMimeTypes
includes it or fallback to application/octet-stream
if unknown.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(File file, boolean inline, Optional<String> fileName, FileMimeTypes fileMimeTypes, Runnable onClose, Executor executor)
file
- The file to send.fileName
- The file name rendered in the Content-Disposition
header. The response
will also automatically include the MIME type in the Content-Type
header deducing
it from this file name if fileMimeTypes
includes it or fallback to application/octet-stream
if unknown.inline
- True if the file should be sent inline, false if it should be sent as an
attachment.fileMimeTypes
- Used for file type mapping.onClose
- Useful in order to perform cleanup operations (e.g. deleting a temporary file
generated for a download).executor
- The executor to use for asynchronous execution of onClose
.public Result chunked(akka.stream.javadsl.Source<akka.util.ByteString,?> chunks)
chunks
- the chunks to sendpublic Result chunked(akka.stream.javadsl.Source<akka.util.ByteString,?> chunks, Optional<String> contentType)
chunks
- the chunks to sendcontentType
- the entity content type.public Result chunked(akka.stream.javadsl.Source<akka.util.ByteString,?> chunks, boolean inline, Optional<String> fileName)
chunks
- the chunks to sendinline
- Whether it should be served as an inline file, or as an attachment.fileName
- The file name rendered in the Content-Disposition
header. The response
will also automatically include the MIME type in the Content-Type
header deducing
it from this file name or fallback to application/octet-stream
if unknown.public Result chunked(akka.stream.javadsl.Source<akka.util.ByteString,?> chunks, boolean inline, Optional<String> fileName, FileMimeTypes fileMimeTypes)
chunks
- the chunks to sendinline
- Whether it should be served as an inline file, or as an attachment.fileName
- The file name rendered in the Content-Disposition
header. The response
will also automatically include the MIME type in the Content-Type
header deducing
it from this file name if fileMimeTypes
includes it or fallback to application/octet-stream
if unknown.fileMimeTypes
- Used for file type mapping.public Result streamed(akka.stream.javadsl.Source<akka.util.ByteString,?> body, Optional<Long> contentLength)
body
- the source to sendcontentLength
- the entity content length.public Result streamed(akka.stream.javadsl.Source<akka.util.ByteString,?> body, Optional<Long> contentLength, Optional<String> contentType)
body
- the source to sendcontentLength
- the entity content length.contentType
- the entity content type.public Result streamed(akka.stream.javadsl.Source<akka.util.ByteString,?> body, Optional<Long> contentLength, boolean inline, Optional<String> fileName)
body
- the source to sendcontentLength
- the entity content length.inline
- Whether it should be served as an inline file, or as an attachment.fileName
- The file name rendered in the Content-Disposition
header. The response
will also automatically include the MIME type in the Content-Type
header deducing
it from this file name or fallback to application/octet-stream
if unknown.public Result streamed(akka.stream.javadsl.Source<akka.util.ByteString,?> body, Optional<Long> contentLength, boolean inline, Optional<String> fileName, FileMimeTypes fileMimeTypes)
body
- the source to sendcontentLength
- the entity content length.inline
- Whether it should be served as an inline file, or as an attachment.fileName
- The file name rendered in the Content-Disposition
header. The response
will also automatically include the MIME type in the Content-Type
header deducing
it from this file name or fallback to application/octet-stream
if unknown.fileMimeTypes
- Used for file type mapping.public Result sendJson(com.fasterxml.jackson.databind.JsonNode json)
json
- the json node to sendpublic Result sendJson(com.fasterxml.jackson.databind.JsonNode json, boolean inline, Optional<String> fileName)
json
- the json node to sendinline
- Whether it should be served as an inline file, or as an attachment.fileName
- The file name rendered in the Content-Disposition
header.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 sendJson(com.fasterxml.jackson.databind.JsonNode json, com.fasterxml.jackson.core.JsonEncoding encoding, boolean inline, Optional<String> fileName)
json
- the json to sendencoding
- the encoding in which to encode the json (e.g. "UTF-8")inline
- Whether it should be served as an inline file, or as an attachment.fileName
- The file name rendered in the Content-Disposition
header.public Result sendEntity(HttpEntity entity)
entity
- the entity to sendpublic Result sendEntity(HttpEntity entity, boolean inline, Optional<String> fileName)
entity
- the entity to sendinline
- Whether it should be served as an inline file, or as an attachment.fileName
- The file name rendered in the Content-Disposition
header. The response
will also automatically include the MIME type in the Content-Type
header deducing
it from this file name or fallback to application/octet-stream
if unknown.public Result sendEntity(HttpEntity entity, boolean inline, Optional<String> fileName, FileMimeTypes fileMimeTypes)
entity
- the entity to sendinline
- Whether it should be served as an inline file, or as an attachment.fileName
- The file name rendered in the Content-Disposition
header. The response
will also automatically include the MIME type in the Content-Type
header deducing
it from this file name if fileMimeTypes
includes it or fallback to application/octet-stream
if unknown.fileMimeTypes
- Used for file type mapping.