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,
java.util.Optional<java.lang.String> fileName)
Send a chunked response with the given chunks.
|
Result |
chunked(akka.stream.javadsl.Source<akka.util.ByteString,?> chunks,
boolean inline,
java.util.Optional<java.lang.String> fileName,
FileMimeTypes fileMimeTypes)
Send a chunked response with the given chunks.
|
Result |
chunked(akka.stream.javadsl.Source<akka.util.ByteString,?> chunks,
java.util.Optional<java.lang.String> contentType)
Send a chunked response with the given chunks.
|
Result |
sendBytes(byte[] content)
Send the given bytes.
|
Result |
sendBytes(byte[] content,
boolean inline,
java.util.Optional<java.lang.String> fileName)
Send the given bytes.
|
Result |
sendBytes(byte[] content,
boolean inline,
java.util.Optional<java.lang.String> fileName,
FileMimeTypes fileMimeTypes)
Send the given bytes.
|
Result |
sendBytes(byte[] content,
java.util.Optional<java.lang.String> contentType)
Send the given bytes.
|
Result |
sendByteString(akka.util.ByteString content)
Send the given ByteString.
|
Result |
sendByteString(akka.util.ByteString content,
boolean inline,
java.util.Optional<java.lang.String> fileName)
Send the given ByteString.
|
Result |
sendByteString(akka.util.ByteString content,
boolean inline,
java.util.Optional<java.lang.String> fileName,
FileMimeTypes fileMimeTypes)
Send the given ByteString.
|
Result |
sendByteString(akka.util.ByteString content,
java.util.Optional<java.lang.String> contentType)
Send the given ByteString.
|
Result |
sendEntity(HttpEntity entity)
Send an HTTP entity.
|
Result |
sendEntity(HttpEntity entity,
boolean inline,
java.util.Optional<java.lang.String> fileName)
Send an HTTP entity.
|
Result |
sendEntity(HttpEntity entity,
boolean inline,
java.util.Optional<java.lang.String> fileName,
FileMimeTypes fileMimeTypes)
Send an HTTP 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,
FileMimeTypes fileMimeTypes,
java.lang.Runnable onClose,
java.util.concurrent.Executor executor)
Sends the given file.
|
Result |
sendFile(java.io.File file,
boolean inline,
java.util.Optional<java.lang.String> fileName)
Send the given file.
|
Result |
sendFile(java.io.File file,
boolean inline,
java.util.Optional<java.lang.String> fileName,
FileMimeTypes fileMimeTypes)
Send the given file.
|
Result |
sendFile(java.io.File file,
boolean inline,
java.util.Optional<java.lang.String> fileName,
FileMimeTypes fileMimeTypes,
java.lang.Runnable onClose,
java.util.concurrent.Executor executor)
Send the given file.
|
Result |
sendFile(java.io.File file,
boolean inline,
java.util.Optional<java.lang.String> fileName,
java.lang.Runnable onClose,
java.util.concurrent.Executor executor)
Send the given file.
|
Result |
sendFile(java.io.File file,
boolean inline,
java.lang.Runnable onClose,
java.util.concurrent.Executor executor)
Sends the given file.
|
Result |
sendFile(java.io.File file,
boolean inline,
java.lang.String fileName)
Deprecated.
Deprecated as of 2.8.0. Use to
sendFile(File, boolean, Optional) . |
Result |
sendFile(java.io.File file,
boolean inline,
java.lang.String fileName,
FileMimeTypes fileMimeTypes)
Deprecated.
Deprecated as of 2.8.0. Use to
sendFile(File, boolean, Optional,
FileMimeTypes) . |
Result |
sendFile(java.io.File file,
FileMimeTypes fileMimeTypes)
Sends the given file using the default inline mode.
|
Result |
sendFile(java.io.File file,
FileMimeTypes fileMimeTypes,
java.lang.Runnable onClose,
java.util.concurrent.Executor executor)
Sends the given file using the default inline mode.
|
Result |
sendFile(java.io.File file,
java.util.Optional<java.lang.String> fileName)
Send the given file.
|
Result |
sendFile(java.io.File file,
java.util.Optional<java.lang.String> fileName,
FileMimeTypes fileMimeTypes)
Send the given file.
|
Result |
sendFile(java.io.File file,
java.util.Optional<java.lang.String> fileName,
FileMimeTypes fileMimeTypes,
java.lang.Runnable onClose,
java.util.concurrent.Executor executor)
Send the given file.
|
Result |
sendFile(java.io.File file,
java.util.Optional<java.lang.String> fileName,
java.lang.Runnable onClose,
java.util.concurrent.Executor executor)
Send the given file.
|
Result |
sendFile(java.io.File file,
java.lang.Runnable onClose,
java.util.concurrent.Executor executor)
Sends the given file using the default inline mode.
|
Result |
sendFile(java.io.File file,
java.lang.String fileName)
Deprecated.
Deprecated as of 2.8.0. Use to
sendFile(File, Optional) . |
Result |
sendFile(java.io.File file,
java.lang.String fileName,
FileMimeTypes fileMimeTypes)
Deprecated.
Deprecated as of 2.8.0. Use to
sendFile(File, Optional, FileMimeTypes) . |
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 |
sendInputStream(java.io.InputStream stream,
long contentLength,
java.util.Optional<java.lang.String> contentType)
Send the given input stream.
|
Result |
sendInputStream(java.io.InputStream stream,
long contentLength,
java.util.Optional<java.lang.String> contentType,
java.lang.Runnable onClose,
java.util.concurrent.Executor executor)
Send the given input stream.
|
Result |
sendInputStream(java.io.InputStream stream,
long contentLength,
java.lang.Runnable onClose,
java.util.concurrent.Executor executor)
Send the given input stream.
|
Result |
sendInputStream(java.io.InputStream stream,
java.util.Optional<java.lang.String> contentType)
Send the given input stream.
|
Result |
sendInputStream(java.io.InputStream stream,
java.util.Optional<java.lang.String> contentType,
java.lang.Runnable onClose,
java.util.concurrent.Executor executor)
Send the given input stream.
|
Result |
sendInputStream(java.io.InputStream stream,
java.lang.Runnable onClose,
java.util.concurrent.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,
java.util.Optional<java.lang.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,
java.util.Optional<java.lang.String> fileName)
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,
FileMimeTypes fileMimeTypes,
java.lang.Runnable onClose,
java.util.concurrent.Executor executor)
Sends the given path if it is a valid file.
|
Result |
sendPath(java.nio.file.Path path,
boolean inline,
java.util.Optional<java.lang.String> filename)
Sends the given path if it is a valid file.
|
Result |
sendPath(java.nio.file.Path path,
boolean inline,
java.util.Optional<java.lang.String> filename,
FileMimeTypes fileMimeTypes)
Sends the given path if it is a valid file.
|
Result |
sendPath(java.nio.file.Path path,
boolean inline,
java.util.Optional<java.lang.String> filename,
FileMimeTypes fileMimeTypes,
java.lang.Runnable onClose,
java.util.concurrent.Executor executor)
Sends the given path if it is a valid file.
|
Result |
sendPath(java.nio.file.Path path,
boolean inline,
java.util.Optional<java.lang.String> filename,
java.lang.Runnable onClose,
java.util.concurrent.Executor executor)
Sends the given path if it is a valid file.
|
Result |
sendPath(java.nio.file.Path path,
boolean inline,
java.lang.Runnable onClose,
java.util.concurrent.Executor executor)
Sends the given path if it is a valid file.
|
Result |
sendPath(java.nio.file.Path path,
boolean inline,
java.lang.String filename)
Deprecated.
Deprecated as of 2.8.0. Use to
sendPath(Path, boolean, Optional) . |
Result |
sendPath(java.nio.file.Path path,
boolean inline,
java.lang.String filename,
FileMimeTypes fileMimeTypes)
Deprecated.
Deprecated as of 2.8.0. Use to
sendPath(Path, boolean, Optional,
FileMimeTypes) . |
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,
FileMimeTypes fileMimeTypes,
java.lang.Runnable onClose,
java.util.concurrent.Executor executor)
Sends the given path if it is a valid file.
|
Result |
sendPath(java.nio.file.Path path,
java.util.Optional<java.lang.String> filename)
Sends the given path if it is a valid file.
|
Result |
sendPath(java.nio.file.Path path,
java.util.Optional<java.lang.String> filename,
FileMimeTypes fileMimeTypes)
Sends the given path if it is a valid file.
|
Result |
sendPath(java.nio.file.Path path,
java.util.Optional<java.lang.String> filename,
FileMimeTypes fileMimeTypes,
java.lang.Runnable onClose,
java.util.concurrent.Executor executor)
Sends the given path if it is a valid file.
|
Result |
sendPath(java.nio.file.Path path,
java.util.Optional<java.lang.String> filename,
java.lang.Runnable onClose,
java.util.concurrent.Executor executor)
Sends the given path if it is a valid file.
|
Result |
sendPath(java.nio.file.Path path,
java.lang.Runnable onClose,
java.util.concurrent.Executor executor)
Sends the given path if it is a valid file.
|
Result |
sendPath(java.nio.file.Path path,
java.lang.String filename)
Deprecated.
Deprecated as of 2.8.0. Use to
sendPath(Path, Optional) . |
Result |
sendPath(java.nio.file.Path path,
java.lang.String filename,
FileMimeTypes fileMimeTypes)
Deprecated.
Deprecated as of 2.8.0. Use to
sendPath(Path, Optional, FileMimeTypes) . |
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,
FileMimeTypes fileMimeTypes,
java.lang.Runnable onClose,
java.util.concurrent.Executor executor)
Send the given resource.
|
Result |
sendResource(java.lang.String resourceName,
boolean inline,
java.util.Optional<java.lang.String> filename)
Send the given resource.
|
Result |
sendResource(java.lang.String resourceName,
boolean inline,
java.util.Optional<java.lang.String> filename,
FileMimeTypes fileMimeTypes)
Send the given resource.
|
Result |
sendResource(java.lang.String resourceName,
boolean inline,
java.util.Optional<java.lang.String> filename,
FileMimeTypes fileMimeTypes,
java.lang.Runnable onClose,
java.util.concurrent.Executor executor)
Send the given resource.
|
Result |
sendResource(java.lang.String resourceName,
boolean inline,
java.util.Optional<java.lang.String> filename,
java.lang.Runnable onClose,
java.util.concurrent.Executor executor)
Send the given resource.
|
Result |
sendResource(java.lang.String resourceName,
boolean inline,
java.lang.Runnable onClose,
java.util.concurrent.Executor executor)
Send the given resource.
|
Result |
sendResource(java.lang.String resourceName,
boolean inline,
java.lang.String filename)
Deprecated.
Deprecated as of 2.8.0. Use
sendResource(String,boolean,Optional) . |
Result |
sendResource(java.lang.String resourceName,
boolean inline,
java.lang.String filename,
FileMimeTypes fileMimeTypes)
Deprecated.
Deprecated as of 2.8.0. Use to
sendResource(String, boolean, Optional,
FileMimeTypes) . |
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,
FileMimeTypes fileMimeTypes,
java.lang.Runnable onClose,
java.util.concurrent.Executor executor)
Send the given resource from the given classloader.
|
Result |
sendResource(java.lang.String resourceName,
java.lang.ClassLoader classLoader,
boolean inline,
java.util.Optional<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.util.Optional<java.lang.String> filename,
FileMimeTypes fileMimeTypes)
Send the given resource from the given classloader.
|
Result |
sendResource(java.lang.String resourceName,
java.lang.ClassLoader classLoader,
boolean inline,
java.util.Optional<java.lang.String> filename,
FileMimeTypes fileMimeTypes,
java.lang.Runnable onClose,
java.util.concurrent.Executor executor)
Send the given resource from the given classloader.
|
Result |
sendResource(java.lang.String resourceName,
java.lang.ClassLoader classLoader,
boolean inline,
java.util.Optional<java.lang.String> filename,
java.lang.Runnable onClose,
java.util.concurrent.Executor executor)
Send the given resource from the given classloader.
|
Result |
sendResource(java.lang.String resourceName,
java.lang.ClassLoader classLoader,
boolean inline,
java.lang.Runnable onClose,
java.util.concurrent.Executor executor)
Send the given resource from the given classloader.
|
Result |
sendResource(java.lang.String resourceName,
java.lang.ClassLoader classLoader,
boolean inline,
java.lang.String filename)
Deprecated.
Deprecated as of 2.8.0. Use to
sendResource(String, ClassLoader, boolean,
Optional) . |
Result |
sendResource(java.lang.String resourceName,
java.lang.ClassLoader classLoader,
boolean inline,
java.lang.String filename,
FileMimeTypes fileMimeTypes)
Deprecated.
Deprecated as of 2.8.0. Use to
sendResource(String, ClassLoader, boolean,
Optional, FileMimeTypes) . |
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,
java.lang.ClassLoader classLoader,
FileMimeTypes fileMimeTypes,
java.lang.Runnable onClose,
java.util.concurrent.Executor executor)
Send the given resource from the given classloader.
|
Result |
sendResource(java.lang.String resourceName,
java.lang.ClassLoader classLoader,
java.util.Optional<java.lang.String> fileName)
Send the given resource from the given classloader.
|
Result |
sendResource(java.lang.String resourceName,
java.lang.ClassLoader classLoader,
java.util.Optional<java.lang.String> fileName,
FileMimeTypes fileMimeTypes)
Send the given resource from the given classloader.
|
Result |
sendResource(java.lang.String resourceName,
java.lang.ClassLoader classLoader,
java.util.Optional<java.lang.String> fileName,
FileMimeTypes fileMimeTypes,
java.lang.Runnable onClose,
java.util.concurrent.Executor executor)
Send the given resource from the given classloader.
|
Result |
sendResource(java.lang.String resourceName,
java.lang.ClassLoader classLoader,
java.util.Optional<java.lang.String> fileName,
java.lang.Runnable onClose,
java.util.concurrent.Executor executor)
Send the given resource from the given classloader.
|
Result |
sendResource(java.lang.String resourceName,
java.lang.ClassLoader classLoader,
java.lang.Runnable onClose,
java.util.concurrent.Executor executor)
Send the given resource from the given classloader.
|
Result |
sendResource(java.lang.String resourceName,
FileMimeTypes fileMimeTypes)
Send the given resource.
|
Result |
sendResource(java.lang.String resourceName,
FileMimeTypes fileMimeTypes,
java.lang.Runnable onClose,
java.util.concurrent.Executor executor)
Send the given resource.
|
Result |
sendResource(java.lang.String resourceName,
java.util.Optional<java.lang.String> fileName)
Send the given resource.
|
Result |
sendResource(java.lang.String resourceName,
java.util.Optional<java.lang.String> fileName,
FileMimeTypes fileMimeTypes)
Send the given resource.
|
Result |
sendResource(java.lang.String resourceName,
java.util.Optional<java.lang.String> fileName,
FileMimeTypes fileMimeTypes,
java.lang.Runnable onClose,
java.util.concurrent.Executor executor)
Send the given resource.
|
Result |
sendResource(java.lang.String resourceName,
java.util.Optional<java.lang.String> fileName,
java.lang.Runnable onClose,
java.util.concurrent.Executor executor)
Send the given resource.
|
Result |
sendResource(java.lang.String resourceName,
java.lang.Runnable onClose,
java.util.concurrent.Executor executor)
Send the given resource.
|
Result |
streamed(akka.stream.javadsl.Source<akka.util.ByteString,?> body,
java.util.Optional<java.lang.Long> contentLength)
Send a streamed response with the given source.
|
Result |
streamed(akka.stream.javadsl.Source<akka.util.ByteString,?> body,
java.util.Optional<java.lang.Long> contentLength,
boolean inline,
java.util.Optional<java.lang.String> fileName)
Send a streamed response with the given source.
|
Result |
streamed(akka.stream.javadsl.Source<akka.util.ByteString,?> body,
java.util.Optional<java.lang.Long> contentLength,
boolean inline,
java.util.Optional<java.lang.String> fileName,
FileMimeTypes fileMimeTypes)
Send a streamed response with the given source.
|
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, withLang, withNewFlash, withNewSession, withoutHeader, withoutLang, withSession, withSession
public Result sendInputStream(java.io.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(java.io.InputStream stream, java.lang.Runnable onClose, java.util.concurrent.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(java.io.InputStream stream, java.util.Optional<java.lang.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(java.io.InputStream stream, java.util.Optional<java.lang.String> contentType, java.lang.Runnable onClose, java.util.concurrent.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(java.io.InputStream stream, long contentLength)
stream
- The input stream to send.contentLength
- The length of the content in the stream.public Result sendInputStream(java.io.InputStream stream, long contentLength, java.lang.Runnable onClose, java.util.concurrent.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(java.io.InputStream stream, long contentLength, java.util.Optional<java.lang.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(java.io.InputStream stream, long contentLength, java.util.Optional<java.lang.String> contentType, java.lang.Runnable onClose, java.util.concurrent.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, java.util.Optional<java.lang.String> contentType)
content
- The bytes to send.contentType
- the entity content type.public Result sendBytes(byte[] content, boolean inline, java.util.Optional<java.lang.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, java.util.Optional<java.lang.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, java.util.Optional<java.lang.String> contentType)
content
- The ByteString to send.contentType
- the entity content type.public Result sendByteString(akka.util.ByteString content, boolean inline, java.util.Optional<java.lang.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, java.util.Optional<java.lang.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(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.Runnable onClose, java.util.concurrent.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(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, FileMimeTypes fileMimeTypes, java.lang.Runnable onClose, java.util.concurrent.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(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, java.lang.Runnable onClose, java.util.concurrent.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(java.lang.String resourceName, java.lang.ClassLoader classLoader, java.util.Optional<java.lang.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(java.lang.String resourceName, java.lang.ClassLoader classLoader, java.util.Optional<java.lang.String> fileName, java.lang.Runnable onClose, java.util.concurrent.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(java.lang.String resourceName, java.lang.ClassLoader classLoader, java.util.Optional<java.lang.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(java.lang.String resourceName, java.lang.ClassLoader classLoader, java.util.Optional<java.lang.String> fileName, FileMimeTypes fileMimeTypes, java.lang.Runnable onClose, java.util.concurrent.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(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, java.lang.ClassLoader classLoader, FileMimeTypes fileMimeTypes, java.lang.Runnable onClose, java.util.concurrent.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(java.lang.String resourceName, java.util.Optional<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.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(java.lang.String resourceName, java.util.Optional<java.lang.String> fileName, java.lang.Runnable onClose, java.util.concurrent.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(java.lang.String resourceName, java.util.Optional<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.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(java.lang.String resourceName, java.util.Optional<java.lang.String> fileName, FileMimeTypes fileMimeTypes, java.lang.Runnable onClose, java.util.concurrent.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(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, java.lang.Runnable onClose, java.util.concurrent.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(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, boolean inline, FileMimeTypes fileMimeTypes, java.lang.Runnable onClose, java.util.concurrent.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(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, java.lang.Runnable onClose, java.util.concurrent.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(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, java.lang.ClassLoader classLoader, boolean inline, FileMimeTypes fileMimeTypes, java.lang.Runnable onClose, java.util.concurrent.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(java.lang.String resourceName, boolean inline, java.lang.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(java.lang.String resourceName, boolean inline, java.util.Optional<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 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(java.lang.String resourceName, boolean inline, java.util.Optional<java.lang.String> filename, java.lang.Runnable onClose, java.util.concurrent.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(java.lang.String resourceName, boolean inline, java.lang.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(java.lang.String resourceName, boolean inline, java.util.Optional<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 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(java.lang.String resourceName, boolean inline, java.util.Optional<java.lang.String> filename, FileMimeTypes fileMimeTypes, java.lang.Runnable onClose, java.util.concurrent.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(java.lang.String resourceName, java.lang.ClassLoader classLoader, boolean inline, java.lang.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(java.lang.String resourceName, java.lang.ClassLoader classLoader, boolean inline, java.util.Optional<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 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(java.lang.String resourceName, java.lang.ClassLoader classLoader, boolean inline, java.util.Optional<java.lang.String> filename, java.lang.Runnable onClose, java.util.concurrent.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(java.lang.String resourceName, java.lang.ClassLoader classLoader, boolean inline, java.lang.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(java.lang.String resourceName, java.lang.ClassLoader classLoader, boolean inline, java.util.Optional<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 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(java.lang.String resourceName, java.lang.ClassLoader classLoader, boolean inline, java.util.Optional<java.lang.String> filename, FileMimeTypes fileMimeTypes, java.lang.Runnable onClose, java.util.concurrent.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(java.nio.file.Path path)
path
- The path to send.public Result sendPath(java.nio.file.Path path, java.lang.Runnable onClose, java.util.concurrent.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(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, FileMimeTypes fileMimeTypes, java.lang.Runnable onClose, java.util.concurrent.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(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.Runnable onClose, java.util.concurrent.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(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, boolean inline, FileMimeTypes fileMimeTypes, java.lang.Runnable onClose, java.util.concurrent.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(java.nio.file.Path path, java.lang.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(java.nio.file.Path path, java.util.Optional<java.lang.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(java.nio.file.Path path, java.util.Optional<java.lang.String> filename, java.lang.Runnable onClose, java.util.concurrent.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(java.nio.file.Path path, java.lang.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(java.nio.file.Path path, java.util.Optional<java.lang.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(java.nio.file.Path path, java.util.Optional<java.lang.String> filename, FileMimeTypes fileMimeTypes, java.lang.Runnable onClose, java.util.concurrent.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(java.nio.file.Path path, boolean inline, java.lang.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(java.nio.file.Path path, boolean inline, java.util.Optional<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 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(java.nio.file.Path path, boolean inline, java.util.Optional<java.lang.String> filename, java.lang.Runnable onClose, java.util.concurrent.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(java.nio.file.Path path, boolean inline, java.lang.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(java.nio.file.Path path, boolean inline, java.util.Optional<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 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(java.nio.file.Path path, boolean inline, java.util.Optional<java.lang.String> filename, FileMimeTypes fileMimeTypes, java.lang.Runnable onClose, java.util.concurrent.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(java.io.File file)
file
- The file to send.public Result sendFile(java.io.File file, java.lang.Runnable onClose, java.util.concurrent.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(java.io.File file, FileMimeTypes fileMimeTypes)
file
- The file to send.fileMimeTypes
- Used for file type mapping.public Result sendFile(java.io.File file, FileMimeTypes fileMimeTypes, java.lang.Runnable onClose, java.util.concurrent.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(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, java.lang.Runnable onClose, java.util.concurrent.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(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, boolean inline, FileMimeTypes fileMimeTypes, java.lang.Runnable onClose, java.util.concurrent.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(java.io.File file, java.lang.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(java.io.File file, java.util.Optional<java.lang.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(java.io.File file, java.util.Optional<java.lang.String> fileName, java.lang.Runnable onClose, java.util.concurrent.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(java.io.File file, java.lang.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(java.io.File file, java.util.Optional<java.lang.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(java.io.File file, java.util.Optional<java.lang.String> fileName, FileMimeTypes fileMimeTypes, java.lang.Runnable onClose, java.util.concurrent.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(java.io.File file, boolean inline, java.lang.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(java.io.File file, boolean inline, java.util.Optional<java.lang.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(java.io.File file, boolean inline, java.util.Optional<java.lang.String> fileName, java.lang.Runnable onClose, java.util.concurrent.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(java.io.File file, boolean inline, java.lang.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(java.io.File file, boolean inline, java.util.Optional<java.lang.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(java.io.File file, boolean inline, java.util.Optional<java.lang.String> fileName, FileMimeTypes fileMimeTypes, java.lang.Runnable onClose, java.util.concurrent.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, java.util.Optional<java.lang.String> contentType)
chunks
- the chunks to sendcontentType
- the entity content type.public Result chunked(akka.stream.javadsl.Source<akka.util.ByteString,?> chunks, boolean inline, java.util.Optional<java.lang.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, java.util.Optional<java.lang.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, java.util.Optional<java.lang.Long> contentLength)
body
- the source to sendcontentLength
- the entity content length.public 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 streamed(akka.stream.javadsl.Source<akka.util.ByteString,?> body, java.util.Optional<java.lang.Long> contentLength, boolean inline, java.util.Optional<java.lang.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, java.util.Optional<java.lang.Long> contentLength, boolean inline, java.util.Optional<java.lang.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, java.util.Optional<java.lang.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, java.util.Optional<java.lang.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, java.util.Optional<java.lang.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, java.util.Optional<java.lang.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.