Package play.mvc
Class Results
- Object
-
- play.mvc.Results
-
- Direct Known Subclasses:
Action
,Controller
,CSRFErrorHandler.DefaultCSRFErrorHandler
,Security.Authenticator
public class Results extends Object
Common results.
-
-
Constructor Summary
Constructors Constructor Description Results()
-
Method Summary
All Methods Static Methods Concrete Methods Deprecated Methods Modifier and Type Method Description static StatusHeader
badRequest()
Generates a 400 Bad Request result.static Result
badRequest(byte[] content)
Generates a 400 Bad Request result.static Result
badRequest(com.fasterxml.jackson.databind.JsonNode content)
Generates a 400 Bad Request result.static Result
badRequest(com.fasterxml.jackson.databind.JsonNode content, com.fasterxml.jackson.core.JsonEncoding encoding)
Generates a 400 Bad Request result.static Result
badRequest(File content)
Generates a 400 Bad Request result.static Result
badRequest(File content, boolean inline)
Generates a 400 Bad Request result.static Result
badRequest(File content, boolean inline, Optional<String> filename)
Generates a 400 Bad Request result.static Result
badRequest(File content, boolean inline, Optional<String> filename, FileMimeTypes fileMimeTypes)
Generates a 400 Bad Request result.static Result
badRequest(File content, boolean inline, FileMimeTypes fileMimeTypes)
Generates a 400 Bad Request result.static Result
badRequest(File content, String filename)
Deprecated.Deprecated as of 2.8.0.static Result
badRequest(File content, String filename, FileMimeTypes fileMimeTypes)
Deprecated.Deprecated as of 2.8.0.static Result
badRequest(File content, Optional<String> filename)
Generates a 400 Bad Request result.static Result
badRequest(File content, Optional<String> filename, FileMimeTypes fileMimeTypes)
Generates a 400 Bad Request result.static Result
badRequest(File content, FileMimeTypes fileMimeTypes)
Generates a 400 Bad Request result.static Result
badRequest(InputStream content)
Generates a 400 Bad Request result.static Result
badRequest(InputStream content, long contentLength)
Generates a 400 Bad Request result.static Result
badRequest(String content)
Generates a 400 Bad Request result.static Result
badRequest(String content, String charset)
Generates a 400 Bad Request result.static Result
badRequest(Path content)
Generates a 400 Bad Request result.static Result
badRequest(Path content, boolean inline)
Generates a 400 Bad Request result.static Result
badRequest(Path content, boolean inline, Optional<String> filename)
Generates a 400 Bad Request result.static Result
badRequest(Path content, boolean inline, Optional<String> filename, FileMimeTypes fileMimeTypes)
Generates a 400 Bad Request result.static Result
badRequest(Path content, boolean inline, FileMimeTypes fileMimeTypes)
Generates a 400 Bad Request result.static Result
badRequest(Path content, Optional<String> filename)
Generates a 400 Bad Request result.static Result
badRequest(Path content, Optional<String> filename, FileMimeTypes fileMimeTypes)
Generates a 400 Bad Request result.static Result
badRequest(Path content, FileMimeTypes fileMimeTypes)
Generates a 400 Bad Request result.static Result
badRequest(play.twirl.api.Content content)
Generates a 400 Bad Request result.static Result
badRequest(play.twirl.api.Content content, String charset)
Generates a 400 Bad Request result.static Map<String,String>
contentDispositionHeader(boolean inline, Optional<String> name)
Creates aContent-Disposition
header.
According to RFC 6266 (Section 4.2) there is no need to send the header"Content-Disposition: inline"
.static StatusHeader
created()
Generates a 201 Created result.static Result
created(byte[] content)
Generates a 201 Created result.static Result
created(com.fasterxml.jackson.databind.JsonNode content)
Generates a 201 Created result.static Result
created(com.fasterxml.jackson.databind.JsonNode content, com.fasterxml.jackson.core.JsonEncoding encoding)
Generates a 201 Created result.static Result
created(File content)
Generates a 201 Created result.static Result
created(File content, boolean inline)
Generates a 201 Created result.static Result
created(File content, boolean inline, Optional<String> filename)
Generates a 201 Created result.static Result
created(File content, boolean inline, Optional<String> filename, FileMimeTypes fileMimeTypes)
Generates a 201 Created result.static Result
created(File content, boolean inline, FileMimeTypes fileMimeTypes)
Generates a 201 Created result.static Result
created(File content, String filename)
Deprecated.Deprecated as of 2.8.0.static Result
created(File content, String filename, FileMimeTypes fileMimeTypes)
Deprecated.Deprecated as of 2.8.0.static Result
created(File content, Optional<String> filename)
Generates a 201 Created result.static Result
created(File content, Optional<String> filename, FileMimeTypes fileMimeTypes)
Generates a 201 Created result.static Result
created(File content, FileMimeTypes fileMimeTypes)
Generates a 201 Created result.static Result
created(InputStream content)
Generates a 201 Created result.static Result
created(InputStream content, long contentLength)
Generates a 201 Created result.static Result
created(String content)
Generates a 201 Created result.static Result
created(String content, String charset)
Generates a 201 Created result.static Result
created(Path content)
Generates a 201 Created result.static Result
created(Path content, boolean inline)
Generates a 201 Created result.static Result
created(Path content, boolean inline, Optional<String> filename)
Generates a 201 Created result.static Result
created(Path content, boolean inline, Optional<String> filename, FileMimeTypes fileMimeTypes)
Generates a 201 Created result.static Result
created(Path content, boolean inline, FileMimeTypes fileMimeTypes)
Generates a 201 Created result.static Result
created(Path content, Optional<String> filename)
Generates a 201 Created result.static Result
created(Path content, Optional<String> filename, FileMimeTypes fileMimeTypes)
Generates a 201 Created result.static Result
created(Path content, FileMimeTypes fileMimeTypes)
Generates a 201 Created result.static Result
created(play.twirl.api.Content content)
Generates a 201 Created result.static Result
created(play.twirl.api.Content content, String charset)
Generates a 201 Created result.static StatusHeader
forbidden()
Generates a 403 Forbidden result.static Result
forbidden(byte[] content)
Generates a 403 Forbidden result.static Result
forbidden(com.fasterxml.jackson.databind.JsonNode content)
Generates a 403 Forbidden result.static Result
forbidden(com.fasterxml.jackson.databind.JsonNode content, com.fasterxml.jackson.core.JsonEncoding encoding)
Generates a 403 Forbidden result.static Result
forbidden(File content)
Generates a 403 Forbidden result.static Result
forbidden(File content, boolean inline)
Generates a 403 Forbidden result.static Result
forbidden(File content, boolean inline, Optional<String> filename)
Generates a 403 Forbidden result.static Result
forbidden(File content, boolean inline, Optional<String> filename, FileMimeTypes fileMimeTypes)
Generates a 403 Forbidden result.static Result
forbidden(File content, boolean inline, FileMimeTypes fileMimeTypes)
Generates a 403 Forbidden result.static Result
forbidden(File content, String filename)
Deprecated.Deprecated as of 2.8.0.static Result
forbidden(File content, String filename, FileMimeTypes fileMimeTypes)
Deprecated.Deprecated as of 2.8.0.static Result
forbidden(File content, Optional<String> filename)
Generates a 403 Forbidden result.static Result
forbidden(File content, Optional<String> filename, FileMimeTypes fileMimeTypes)
Generates a 403 Forbidden result.static Result
forbidden(File content, FileMimeTypes fileMimeTypes)
Generates a 403 Forbidden result.static Result
forbidden(InputStream content)
Generates a 403 Forbidden result.static Result
forbidden(InputStream content, long contentLength)
Generates a 403 Forbidden result.static Result
forbidden(String content)
Generates a 403 Forbidden result.static Result
forbidden(String content, String charset)
Generates a 403 Forbidden result.static Result
forbidden(Path content)
Generates a 403 Forbidden result.static Result
forbidden(Path content, boolean inline)
Generates a 403 Forbidden result.static Result
forbidden(Path content, boolean inline, Optional<String> filename)
Generates a 403 Forbidden result.static Result
forbidden(Path content, boolean inline, Optional<String> filename, FileMimeTypes fileMimeTypes)
Generates a 403 Forbidden result.static Result
forbidden(Path content, boolean inline, FileMimeTypes fileMimeTypes)
Generates a 403 Forbidden result.static Result
forbidden(Path content, Optional<String> filename)
Generates a 403 Forbidden result.static Result
forbidden(Path content, Optional<String> filename, FileMimeTypes fileMimeTypes)
Generates a 403 Forbidden result.static Result
forbidden(Path content, FileMimeTypes fileMimeTypes)
Generates a 403 Forbidden result.static Result
forbidden(play.twirl.api.Content content)
Generates a 403 Forbidden result.static Result
forbidden(play.twirl.api.Content content, String charset)
Generates a 403 Forbidden result.static Result
found(String url)
Generates a 302 Found result.static Result
found(Call call)
Generates a 302 Found result.static StatusHeader
internalServerError()
Generates a 500 Internal Server Error result.static Result
internalServerError(byte[] content)
Generates a 500 Internal Server Error result.static Result
internalServerError(com.fasterxml.jackson.databind.JsonNode content)
Generates a 500 Internal Server Error result.static Result
internalServerError(com.fasterxml.jackson.databind.JsonNode content, com.fasterxml.jackson.core.JsonEncoding encoding)
Generates a 500 Internal Server Error result.static Result
internalServerError(File content)
Generates a 500 Internal Server Error result.static Result
internalServerError(File content, boolean inline)
Generates a 500 Internal Server Error result.static Result
internalServerError(File content, boolean inline, Optional<String> filename)
Generates a 500 Internal Server Error result.static Result
internalServerError(File content, boolean inline, Optional<String> filename, FileMimeTypes fileMimeTypes)
Generates a 500 Internal Server Error result.static Result
internalServerError(File content, boolean inline, FileMimeTypes fileMimeTypes)
Generates a 500 Internal Server Error result.static Result
internalServerError(File content, String filename)
Deprecated.Deprecated as of 2.8.0.static Result
internalServerError(File content, String filename, FileMimeTypes fileMimeTypes)
Deprecated.Deprecated as of 2.8.0.static Result
internalServerError(File content, Optional<String> filename)
Generates a 500 Internal Server Error result.static Result
internalServerError(File content, Optional<String> filename, FileMimeTypes fileMimeTypes)
Generates a 500 Internal Server Error result.static Result
internalServerError(File content, FileMimeTypes fileMimeTypes)
Generates a 500 Internal Server Error result.static Result
internalServerError(InputStream content)
Generates a 500 Internal Server Error result.static Result
internalServerError(InputStream content, long contentLength)
Generates a 500 Internal Server Error result.static Result
internalServerError(String content)
Generates a 500 Internal Server Error result.static Result
internalServerError(String content, String charset)
Generates a 500 Internal Server Error result.static Result
internalServerError(Path content)
Generates a 500 Internal Server Error result.static Result
internalServerError(Path content, boolean inline)
Generates a 500 Internal Server Error result.static Result
internalServerError(Path content, boolean inline, Optional<String> filename)
Generates a 500 Internal Server Error result.static Result
internalServerError(Path content, boolean inline, Optional<String> filename, FileMimeTypes fileMimeTypes)
Generates a 500 Internal Server Error result.static Result
internalServerError(Path content, boolean inline, FileMimeTypes fileMimeTypes)
Generates a 500 Internal Server Error result.static Result
internalServerError(Path content, Optional<String> filename)
Generates a 500 Internal Server Error result.static Result
internalServerError(Path content, Optional<String> filename, FileMimeTypes fileMimeTypes)
Generates a 500 Internal Server Error result.static Result
internalServerError(Path content, FileMimeTypes fileMimeTypes)
Generates a 500 Internal Server Error result.static Result
internalServerError(play.twirl.api.Content content)
Generates a 500 Internal Server Error result.static Result
internalServerError(play.twirl.api.Content content, String charset)
Generates a 500 Internal Server Error result.static Result
movedPermanently(String url)
Generates a 301 Moved Permanently result.static Result
movedPermanently(Call call)
Generates a 301 Moved Permanently result.static StatusHeader
networkAuthenticationRequired()
Generates a 511 Network Authentication Required result.static Result
networkAuthenticationRequired(byte[] content)
Generates a 511 Network Authentication Required result.static Result
networkAuthenticationRequired(com.fasterxml.jackson.databind.JsonNode content)
Generates a 511 Network Authentication Required result.static Result
networkAuthenticationRequired(com.fasterxml.jackson.databind.JsonNode content, com.fasterxml.jackson.core.JsonEncoding encoding)
Generates a 511 Network Authentication Required result.static Result
networkAuthenticationRequired(File content)
Generates a 511 Network Authentication Required result.static Result
networkAuthenticationRequired(File content, boolean inline)
Generates a 511 Network Authentication Required result.static Result
networkAuthenticationRequired(File content, boolean inline, Optional<String> filename)
Generates a 511 Network Authentication Required result.static Result
networkAuthenticationRequired(File content, boolean inline, Optional<String> filename, FileMimeTypes fileMimeTypes)
Generates a 511 Network Authentication Required result.static Result
networkAuthenticationRequired(File content, boolean inline, FileMimeTypes fileMimeTypes)
Generates a 511 Network Authentication Required result.static Result
networkAuthenticationRequired(File content, String filename)
Deprecated.Deprecated as of 2.8.0.static Result
networkAuthenticationRequired(File content, String filename, FileMimeTypes fileMimeTypes)
Deprecated.Deprecated as of 2.8.0.static Result
networkAuthenticationRequired(File content, Optional<String> filename)
Generates a 511 Network Authentication Required result.static Result
networkAuthenticationRequired(File content, Optional<String> filename, FileMimeTypes fileMimeTypes)
Generates a 511 Network Authentication Required result.static Result
networkAuthenticationRequired(File content, FileMimeTypes fileMimeTypes)
Generates a 511 Network Authentication Required result.static Result
networkAuthenticationRequired(InputStream content)
Generates a 511 Network Authentication Required result.static Result
networkAuthenticationRequired(InputStream content, long contentLength)
Generates a 511 Network Authentication Required result.static Result
networkAuthenticationRequired(String content)
Generates a 511 Network Authentication Required result.static Result
networkAuthenticationRequired(String content, String charset)
Generates a 511 Network Authentication Required result.static Result
networkAuthenticationRequired(Path content)
Generates a 511 Network Authentication Required result.static Result
networkAuthenticationRequired(Path content, boolean inline)
Generates a 511 Network Authentication Required result.static Result
networkAuthenticationRequired(Path content, boolean inline, Optional<String> filename)
Generates a 511 Network Authentication Required result.static Result
networkAuthenticationRequired(Path content, boolean inline, Optional<String> filename, FileMimeTypes fileMimeTypes)
Generates a 511 Network Authentication Required result.static Result
networkAuthenticationRequired(Path content, boolean inline, FileMimeTypes fileMimeTypes)
Generates a 511 Network Authentication Required result.static Result
networkAuthenticationRequired(Path content, Optional<String> filename)
Generates a 511 Network Authentication Required result.static Result
networkAuthenticationRequired(Path content, Optional<String> filename, FileMimeTypes fileMimeTypes)
Generates a 511 Network Authentication Required result.static Result
networkAuthenticationRequired(Path content, FileMimeTypes fileMimeTypes)
Generates a 511 Network Authentication Required result.static Result
networkAuthenticationRequired(play.twirl.api.Content content)
Generates a 511 Network Authentication Required result.static Result
networkAuthenticationRequired(play.twirl.api.Content content, String charset)
Generates a 511 Network Authentication Required result.static StatusHeader
noContent()
Generates a 204 No Content result.static StatusHeader
notAcceptable()
Generates a 406 Not Acceptable result.static Result
notAcceptable(byte[] content)
Generates a 406 Not Acceptable result.static Result
notAcceptable(com.fasterxml.jackson.databind.JsonNode content)
Generates a 406 Not Acceptable result.static Result
notAcceptable(com.fasterxml.jackson.databind.JsonNode content, com.fasterxml.jackson.core.JsonEncoding encoding)
Generates a 406 Not Acceptable result.static Result
notAcceptable(File content)
Generates a 406 Not Acceptable result.static Result
notAcceptable(File content, boolean inline)
Generates a 406 Not Acceptable result.static Result
notAcceptable(File content, boolean inline, Optional<String> filename)
Generates a 406 Not Acceptable result.static Result
notAcceptable(File content, boolean inline, Optional<String> filename, FileMimeTypes fileMimeTypes)
Generates a 406 Not Acceptable result.static Result
notAcceptable(File content, boolean inline, FileMimeTypes fileMimeTypes)
Generates a 406 Not Acceptable result.static Result
notAcceptable(File content, String filename)
Deprecated.Deprecated as of 2.8.0.static Result
notAcceptable(File content, String filename, FileMimeTypes fileMimeTypes)
Deprecated.Deprecated as of 2.8.0.static Result
notAcceptable(File content, Optional<String> filename)
Generates a 406 Not Acceptable result.static Result
notAcceptable(File content, Optional<String> filename, FileMimeTypes fileMimeTypes)
Generates a 406 Not Acceptable result.static Result
notAcceptable(File content, FileMimeTypes fileMimeTypes)
Generates a 406 Not Acceptable result.static Result
notAcceptable(InputStream content)
Generates a 406 Not Acceptable result.static Result
notAcceptable(InputStream content, long contentLength)
Generates a 406 Not Acceptable result.static Result
notAcceptable(String content)
Generates a 406 Not Acceptable result.static Result
notAcceptable(String content, String charset)
Generates a 406 Not Acceptable result.static Result
notAcceptable(Path content)
Generates a 406 Not Acceptable result.static Result
notAcceptable(Path content, boolean inline)
Generates a 406 Not Acceptable result.static Result
notAcceptable(Path content, boolean inline, Optional<String> filename)
Generates a 406 Not Acceptable result.static Result
notAcceptable(Path content, boolean inline, Optional<String> filename, FileMimeTypes fileMimeTypes)
Generates a 406 Not Acceptable result.static Result
notAcceptable(Path content, boolean inline, FileMimeTypes fileMimeTypes)
Generates a 406 Not Acceptable result.static Result
notAcceptable(Path content, Optional<String> filename)
Generates a 406 Not Acceptable result.static Result
notAcceptable(Path content, Optional<String> filename, FileMimeTypes fileMimeTypes)
Generates a 406 Not Acceptable result.static Result
notAcceptable(Path content, FileMimeTypes fileMimeTypes)
Generates a 406 Not Acceptable result.static Result
notAcceptable(play.twirl.api.Content content)
Generates a 406 Not Acceptable result.static Result
notAcceptable(play.twirl.api.Content content, String charset)
Generates a 406 Not Acceptable result.static StatusHeader
notFound()
Generates a 404 Not Found result.static Result
notFound(byte[] content)
Generates a 404 Not Found result.static Result
notFound(com.fasterxml.jackson.databind.JsonNode content)
Generates a 404 Not Found result.static Result
notFound(com.fasterxml.jackson.databind.JsonNode content, com.fasterxml.jackson.core.JsonEncoding encoding)
Generates a 404 Not Found result.static Result
notFound(File content)
Generates a 404 Not Found result.static Result
notFound(File content, boolean inline)
Generates a 404 Not Found result.static Result
notFound(File content, boolean inline, Optional<String> filename)
Generates a 404 Not Found result.static Result
notFound(File content, boolean inline, Optional<String> filename, FileMimeTypes fileMimeTypes)
Generates a 404 Not Found result.static Result
notFound(File content, boolean inline, FileMimeTypes fileMimeTypes)
Generates a 404 Not Found result.static Result
notFound(File content, String filename)
Deprecated.Deprecated as of 2.8.0.static Result
notFound(File content, String filename, FileMimeTypes fileMimeTypes)
Deprecated.Deprecated as of 2.8.0.static Result
notFound(File content, Optional<String> filename)
Generates a 404 Not Found result.static Result
notFound(File content, Optional<String> filename, FileMimeTypes fileMimeTypes)
Generates a 404 Not Found result.static Result
notFound(File content, FileMimeTypes fileMimeTypes)
Generates a 404 Not Found result.static Result
notFound(InputStream content)
Generates a 404 Not Found result.static Result
notFound(InputStream content, long contentLength)
Generates a 404 Not Found result.static Result
notFound(String content)
Generates a 404 Not Found result.static Result
notFound(String content, String charset)
Generates a 404 Not Found result.static Result
notFound(Path content)
Generates a 404 Not Found result.static Result
notFound(Path content, boolean inline)
Generates a 404 Not Found result.static Result
notFound(Path content, boolean inline, Optional<String> filename)
Generates a 404 Not Found result.static Result
notFound(Path content, boolean inline, Optional<String> filename, FileMimeTypes fileMimeTypes)
Generates a 404 Not Found result.static Result
notFound(Path content, boolean inline, FileMimeTypes fileMimeTypes)
Generates a 404 Not Found result.static Result
notFound(Path content, Optional<String> filename)
Generates a 404 Not Found result.static Result
notFound(Path content, Optional<String> filename, FileMimeTypes fileMimeTypes)
Generates a 404 Not Found result.static Result
notFound(Path content, FileMimeTypes fileMimeTypes)
Generates a 404 Not Found result.static Result
notFound(play.twirl.api.Content content)
Generates a 404 Not Found result.static Result
notFound(play.twirl.api.Content content, String charset)
Generates a 404 Not Found result.static StatusHeader
ok()
Generates a 200 OK result.static Result
ok(byte[] content)
Generates a 200 OK result.static Result
ok(com.fasterxml.jackson.databind.JsonNode content)
Generates a 200 OK result.static Result
ok(com.fasterxml.jackson.databind.JsonNode content, com.fasterxml.jackson.core.JsonEncoding encoding)
Generates a 200 OK result.static Result
ok(File content)
Generates a 200 OK result.static Result
ok(File content, boolean inline)
Generates a 200 OK result.static Result
ok(File content, boolean inline, Optional<String> filename)
Generates a 200 OK result.static Result
ok(File content, boolean inline, Optional<String> filename, FileMimeTypes fileMimeTypes)
Generates a 200 OK result.static Result
ok(File content, boolean inline, FileMimeTypes fileMimeTypes)
Generates a 200 OK result.static Result
ok(File content, String filename)
Deprecated.Deprecated as of 2.8.0.static Result
ok(File content, String filename, FileMimeTypes fileMimeTypes)
Deprecated.Deprecated as of 2.8.0.static Result
ok(File content, Optional<String> filename)
Generates a 200 OK result.static Result
ok(File content, Optional<String> filename, FileMimeTypes fileMimeTypes)
Generates a 200 OK result.static Result
ok(File content, FileMimeTypes fileMimeTypes)
Generates a 200 OK result.static Result
ok(InputStream content)
Generates a 200 OK result.static Result
ok(InputStream content, long contentLength)
Generates a 200 OK result.static Result
ok(String content)
Generates a 200 OK result.static Result
ok(String content, String charset)
Generates a 200 OK result.static Result
ok(Path content)
Generates a 200 OK result.static Result
ok(Path content, boolean inline)
Generates a 200 OK result.static Result
ok(Path content, boolean inline, Optional<String> filename)
Generates a 200 OK result.static Result
ok(Path content, boolean inline, Optional<String> filename, FileMimeTypes fileMimeTypes)
Generates a 200 OK result.static Result
ok(Path content, boolean inline, FileMimeTypes fileMimeTypes)
Generates a 200 OK result.static Result
ok(Path content, Optional<String> filename)
Generates a 200 OK result.static Result
ok(Path content, Optional<String> filename, FileMimeTypes fileMimeTypes)
Generates a 200 OK result.static Result
ok(Path content, FileMimeTypes fileMimeTypes)
Generates a 200 OK result.static Result
ok(play.twirl.api.Content content)
Generates a 200 OK result.static Result
ok(play.twirl.api.Content content, String charset)
Generates a 200 OK result.static StatusHeader
paymentRequired()
Generates a 402 Payment Required result.static Result
paymentRequired(byte[] content)
Generates a 402 Payment Required result.static Result
paymentRequired(com.fasterxml.jackson.databind.JsonNode content)
Generates a 402 Payment Required result.static Result
paymentRequired(com.fasterxml.jackson.databind.JsonNode content, com.fasterxml.jackson.core.JsonEncoding encoding)
Generates a 402 Payment Required result.static Result
paymentRequired(File content)
Generates a 402 Payment Required result.static Result
paymentRequired(File content, boolean inline)
Generates a 402 Payment Required result.static Result
paymentRequired(File content, boolean inline, Optional<String> filename)
Generates a 402 Payment Required result.static Result
paymentRequired(File content, boolean inline, Optional<String> filename, FileMimeTypes fileMimeTypes)
Generates a 402 Payment Required result.static Result
paymentRequired(File content, boolean inline, FileMimeTypes fileMimeTypes)
Generates a 402 Payment Required result.static Result
paymentRequired(File content, String filename)
Deprecated.Deprecated as of 2.8.0.static Result
paymentRequired(File content, String filename, FileMimeTypes fileMimeTypes)
Deprecated.Deprecated as of 2.8.0.static Result
paymentRequired(File content, Optional<String> filename)
Generates a 402 Payment Required result.static Result
paymentRequired(File content, Optional<String> filename, FileMimeTypes fileMimeTypes)
Generates a 402 Payment Required result.static Result
paymentRequired(File content, FileMimeTypes fileMimeTypes)
Generates a 402 Payment Required result.static Result
paymentRequired(InputStream content)
Generates a 402 Payment Required result.static Result
paymentRequired(InputStream content, long contentLength)
Generates a 402 Payment Required result.static Result
paymentRequired(String content)
Generates a 402 Payment Required result.static Result
paymentRequired(String content, String charset)
Generates a 402 Payment Required result.static Result
paymentRequired(Path content)
Generates a 402 Payment Required result.static Result
paymentRequired(Path content, boolean inline)
Generates a 402 Payment Required result.static Result
paymentRequired(Path content, boolean inline, Optional<String> filename)
Generates a 402 Payment Required result.static Result
paymentRequired(Path content, boolean inline, Optional<String> filename, FileMimeTypes fileMimeTypes)
Generates a 402 Payment Required result.static Result
paymentRequired(Path content, boolean inline, FileMimeTypes fileMimeTypes)
Generates a 402 Payment Required result.static Result
paymentRequired(Path content, Optional<String> filename)
Generates a 402 Payment Required result.static Result
paymentRequired(Path content, Optional<String> filename, FileMimeTypes fileMimeTypes)
Generates a 402 Payment Required result.static Result
paymentRequired(Path content, FileMimeTypes fileMimeTypes)
Generates a 402 Payment Required result.static Result
paymentRequired(play.twirl.api.Content content)
Generates a 402 Payment Required result.static Result
paymentRequired(play.twirl.api.Content content, String charset)
Generates a 402 Payment Required result.static Result
permanentRedirect(String url)
Generates a 308 Permanent Redirect result.static Result
permanentRedirect(Call call)
Generates a 308 Permanent Redirect result.static StatusHeader
preconditionRequired()
Generates a 428 Precondition Required result.static Result
preconditionRequired(byte[] content)
Generates a 428 Precondition Required result.static Result
preconditionRequired(com.fasterxml.jackson.databind.JsonNode content)
Generates a 428 Precondition Required result.static Result
preconditionRequired(com.fasterxml.jackson.databind.JsonNode content, com.fasterxml.jackson.core.JsonEncoding encoding)
Generates a 428 Precondition Required result.static Result
preconditionRequired(File content)
Generates a 428 Precondition Required result.static Result
preconditionRequired(File content, boolean inline)
Generates a 428 Precondition Required result.static Result
preconditionRequired(File content, boolean inline, Optional<String> filename)
Generates a 428 Precondition Required result.static Result
preconditionRequired(File content, boolean inline, Optional<String> filename, FileMimeTypes fileMimeTypes)
Generates a 428 Precondition Required result.static Result
preconditionRequired(File content, boolean inline, FileMimeTypes fileMimeTypes)
Generates a 428 Precondition Required result.static Result
preconditionRequired(File content, String filename)
Deprecated.Deprecated as of 2.8.0.static Result
preconditionRequired(File content, String filename, FileMimeTypes fileMimeTypes)
Deprecated.Deprecated as of 2.8.0.static Result
preconditionRequired(File content, Optional<String> filename)
Generates a 428 Precondition Required result.static Result
preconditionRequired(File content, Optional<String> filename, FileMimeTypes fileMimeTypes)
Generates a 428 Precondition Required result.static Result
preconditionRequired(File content, FileMimeTypes fileMimeTypes)
Generates a 428 Precondition Required result.static Result
preconditionRequired(InputStream content)
Generates a 428 Precondition Required result.static Result
preconditionRequired(InputStream content, long contentLength)
Generates a 428 Precondition Required result.static Result
preconditionRequired(String content)
Generates a 428 Precondition Required result.static Result
preconditionRequired(String content, String charset)
Generates a 428 Precondition Required result.static Result
preconditionRequired(Path content)
Generates a 428 Precondition Required result.static Result
preconditionRequired(Path content, boolean inline)
Generates a 428 Precondition Required result.static Result
preconditionRequired(Path content, boolean inline, Optional<String> filename)
Generates a 428 Precondition Required result.static Result
preconditionRequired(Path content, boolean inline, Optional<String> filename, FileMimeTypes fileMimeTypes)
Generates a 428 Precondition Required result.static Result
preconditionRequired(Path content, boolean inline, FileMimeTypes fileMimeTypes)
Generates a 428 Precondition Required result.static Result
preconditionRequired(Path content, Optional<String> filename)
Generates a 428 Precondition Required result.static Result
preconditionRequired(Path content, Optional<String> filename, FileMimeTypes fileMimeTypes)
Generates a 428 Precondition Required result.static Result
preconditionRequired(Path content, FileMimeTypes fileMimeTypes)
Generates a 428 Precondition Required result.static Result
preconditionRequired(play.twirl.api.Content content)
Generates a 428 Precondition Required result.static Result
preconditionRequired(play.twirl.api.Content content, String charset)
Generates a 428 Precondition Required result.static Result
redirect(String url)
Generates a 303 See Other result.static Result
redirect(String url, Map<String,List<String>> queryStringParams)
Generates a 303 See Other result.static Result
redirect(Call call)
Generates a 303 See Other result.static StatusHeader
requestHeaderFieldsTooLarge()
Generates a 431 Request Header Fields Too Large result.static Result
requestHeaderFieldsTooLarge(byte[] content)
Generates a 431 Request Header Fields Too Large result.static Result
requestHeaderFieldsTooLarge(com.fasterxml.jackson.databind.JsonNode content)
Generates a 431 Request Header Fields Too Large result.static Result
requestHeaderFieldsTooLarge(com.fasterxml.jackson.databind.JsonNode content, com.fasterxml.jackson.core.JsonEncoding encoding)
Generates a 431 Request Header Fields Too Large result.static Result
requestHeaderFieldsTooLarge(File content)
Generates a 431 Request Header Fields Too Large result.static Result
requestHeaderFieldsTooLarge(File content, boolean inline)
Generates a 431 Request Header Fields Too Large result.static Result
requestHeaderFieldsTooLarge(File content, boolean inline, Optional<String> filename)
Generates a 431 Request Header Fields Too Large result.static Result
requestHeaderFieldsTooLarge(File content, boolean inline, Optional<String> filename, FileMimeTypes fileMimeTypes)
Generates a 431 Request Header Fields Too Large result.static Result
requestHeaderFieldsTooLarge(File content, boolean inline, FileMimeTypes fileMimeTypes)
Generates a 431 Request Header Fields Too Large result.static Result
requestHeaderFieldsTooLarge(File content, String filename)
Deprecated.Deprecated as of 2.8.0.static Result
requestHeaderFieldsTooLarge(File content, String filename, FileMimeTypes fileMimeTypes)
Deprecated.Deprecated as of 2.8.0.static Result
requestHeaderFieldsTooLarge(File content, Optional<String> filename)
Generates a 431 Request Header Fields Too Large result.static Result
requestHeaderFieldsTooLarge(File content, Optional<String> filename, FileMimeTypes fileMimeTypes)
Generates a 431 Request Header Fields Too Large result.static Result
requestHeaderFieldsTooLarge(File content, FileMimeTypes fileMimeTypes)
Generates a 431 Request Header Fields Too Large result.static Result
requestHeaderFieldsTooLarge(InputStream content)
Generates a 431 Request Header Fields Too Large result.static Result
requestHeaderFieldsTooLarge(InputStream content, long contentLength)
Generates a 431 Request Header Fields Too Large result.static Result
requestHeaderFieldsTooLarge(String content)
Generates a 431 Request Header Fields Too Large result.static Result
requestHeaderFieldsTooLarge(String content, String charset)
Generates a 431 Request Header Fields Too Large result.static Result
requestHeaderFieldsTooLarge(Path content)
Generates a 431 Request Header Fields Too Large result.static Result
requestHeaderFieldsTooLarge(Path content, boolean inline)
Generates a 431 Request Header Fields Too Large result.static Result
requestHeaderFieldsTooLarge(Path content, boolean inline, Optional<String> filename)
Generates a 431 Request Header Fields Too Large result.static Result
requestHeaderFieldsTooLarge(Path content, boolean inline, Optional<String> filename, FileMimeTypes fileMimeTypes)
Generates a 431 Request Header Fields Too Large result.static Result
requestHeaderFieldsTooLarge(Path content, boolean inline, FileMimeTypes fileMimeTypes)
Generates a 431 Request Header Fields Too Large result.static Result
requestHeaderFieldsTooLarge(Path content, Optional<String> filename)
Generates a 431 Request Header Fields Too Large result.static Result
requestHeaderFieldsTooLarge(Path content, Optional<String> filename, FileMimeTypes fileMimeTypes)
Generates a 431 Request Header Fields Too Large result.static Result
requestHeaderFieldsTooLarge(Path content, FileMimeTypes fileMimeTypes)
Generates a 431 Request Header Fields Too Large result.static Result
requestHeaderFieldsTooLarge(play.twirl.api.Content content)
Generates a 431 Request Header Fields Too Large result.static Result
requestHeaderFieldsTooLarge(play.twirl.api.Content content, String charset)
Generates a 431 Request Header Fields Too Large result.static Result
seeOther(String url)
Generates a 303 See Other result.static Result
seeOther(Call call)
Generates a 303 See Other result.static StatusHeader
status(int status)
Generates a simple result.static Result
status(int status, byte[] content)
Generates a simple result with byte-array content.static Result
status(int status, ByteString content)
Generates a simple result.static Result
status(int status, com.fasterxml.jackson.databind.JsonNode content)
Generates a simple result with json content and UTF8 encoding.static Result
status(int status, com.fasterxml.jackson.databind.JsonNode content, com.fasterxml.jackson.core.JsonEncoding encoding)
Generates a simple result with json content.static Result
status(int status, File content)
Generates a result with file contents.static Result
status(int status, File content, boolean inline)
Generates a result with file content.static Result
status(int status, File content, boolean inline, Optional<String> fileName)
Generates a result.static Result
status(int status, File content, boolean inline, Optional<String> fileName, FileMimeTypes fileMimeTypes)
Generates a result.static Result
status(int status, File content, boolean inline, FileMimeTypes fileMimeTypes)
Generates a result with file content.static Result
status(int status, File content, String fileName)
Deprecated.Deprecated as of 2.8.0.static Result
status(int status, File content, String fileName, FileMimeTypes fileMimeTypes)
Deprecated.Deprecated as of 2.8.0.static Result
status(int status, File content, Optional<String> fileName)
Generates a result.static Result
status(int status, File content, Optional<String> fileName, FileMimeTypes fileMimeTypes)
Generates a result.static Result
status(int status, File content, FileMimeTypes fileMimeTypes)
Generates a result with file contents.static Result
status(int status, InputStream content)
Generates a chunked result.static Result
status(int status, InputStream content, long contentLength)
Generates a chunked result.static Result
status(int status, String content)
Generates a simple result.static Result
status(int status, String content, String charset)
Generates a simple result.static Result
status(int status, Path content)
Generates a result with path contents.static Result
status(int status, Path content, boolean inline)
Generates a result with path content.static Result
status(int status, Path content, boolean inline, Optional<String> fileName)
Generates a result.static Result
status(int status, Path content, boolean inline, Optional<String> fileName, FileMimeTypes fileMimeTypes)
Generates a result.static Result
status(int status, Path content, boolean inline, FileMimeTypes fileMimeTypes)
Generates a result with path content.static Result
status(int status, Path content, Optional<String> fileName)
Generates a result.static Result
status(int status, Path content, Optional<String> fileName, FileMimeTypes fileMimeTypes)
Generates a result.static Result
status(int status, Path content, FileMimeTypes fileMimeTypes)
Generates a result with path contents.static Result
status(int status, play.twirl.api.Content content)
Generates a simple result.static Result
status(int status, play.twirl.api.Content content, String charset)
Generates a simple result.static Result
temporaryRedirect(String url)
Generates a 307 Temporary Redirect result.static Result
temporaryRedirect(Call call)
Generates a 307 Temporary Redirect result.static StatusHeader
tooManyRequests()
Generates a 429 Too Many Requests result.static Result
tooManyRequests(byte[] content)
Generates a 429 Too Many Requests result.static Result
tooManyRequests(com.fasterxml.jackson.databind.JsonNode content)
Generates a 429 Too Many Requests result.static Result
tooManyRequests(com.fasterxml.jackson.databind.JsonNode content, com.fasterxml.jackson.core.JsonEncoding encoding)
Generates a 429 Too Many Requests result.static Result
tooManyRequests(File content)
Generates a 429 Too Many Requests result.static Result
tooManyRequests(File content, boolean inline)
Generates a 429 Too Many Requests result.static Result
tooManyRequests(File content, boolean inline, Optional<String> filename)
Generates a 429 Too Many Requests result.static Result
tooManyRequests(File content, boolean inline, Optional<String> filename, FileMimeTypes fileMimeTypes)
Generates a 429 Too Many Requests result.static Result
tooManyRequests(File content, boolean inline, FileMimeTypes fileMimeTypes)
Generates a 429 Too Many Requests result.static Result
tooManyRequests(File content, String filename)
Deprecated.Deprecated as of 2.8.0.static Result
tooManyRequests(File content, String filename, FileMimeTypes fileMimeTypes)
Deprecated.Deprecated as of 2.8.0.static Result
tooManyRequests(File content, Optional<String> filename)
Generates a 429 Too Many Requests result.static Result
tooManyRequests(File content, Optional<String> filename, FileMimeTypes fileMimeTypes)
Generates a 429 Too Many Requests result.static Result
tooManyRequests(File content, FileMimeTypes fileMimeTypes)
Generates a 429 Too Many Requests result.static Result
tooManyRequests(InputStream content)
Generates a 429 Too Many Requests result.static Result
tooManyRequests(InputStream content, long contentLength)
Generates a 429 Too Many Requests result.static Result
tooManyRequests(String content)
Generates a 429 Too Many Requests result.static Result
tooManyRequests(String content, String charset)
Generates a 429 Too Many Requests result.static Result
tooManyRequests(Path content)
Generates a 429 Too Many Requests result.static Result
tooManyRequests(Path content, boolean inline)
Generates a 429 Too Many Requests result.static Result
tooManyRequests(Path content, boolean inline, Optional<String> filename)
Generates a 429 Too Many Requests result.static Result
tooManyRequests(Path content, boolean inline, Optional<String> filename, FileMimeTypes fileMimeTypes)
Generates a 429 Too Many Requests result.static Result
tooManyRequests(Path content, boolean inline, FileMimeTypes fileMimeTypes)
Generates a 429 Too Many Requests result.static Result
tooManyRequests(Path content, Optional<String> filename)
Generates a 429 Too Many Requests result.static Result
tooManyRequests(Path content, Optional<String> filename, FileMimeTypes fileMimeTypes)
Generates a 429 Too Many Requests result.static Result
tooManyRequests(Path content, FileMimeTypes fileMimeTypes)
Generates a 429 Too Many Requests result.static Result
tooManyRequests(play.twirl.api.Content content)
Generates a 429 Too Many Requests result.static Result
tooManyRequests(play.twirl.api.Content content, String charset)
Generates a 429 Too Many Requests result.static StatusHeader
unauthorized()
Generates a 401 Unauthorized result.static Result
unauthorized(byte[] content)
Generates a 401 Unauthorized result.static Result
unauthorized(com.fasterxml.jackson.databind.JsonNode content)
Generates a 401 Unauthorized result.static Result
unauthorized(com.fasterxml.jackson.databind.JsonNode content, com.fasterxml.jackson.core.JsonEncoding encoding)
Generates a 401 Unauthorized result.static Result
unauthorized(File content)
Generates a 401 Unauthorized result.static Result
unauthorized(File content, boolean inline)
Generates a 401 Unauthorized result.static Result
unauthorized(File content, boolean inline, Optional<String> filename)
Generates a 401 Unauthorized result.static Result
unauthorized(File content, boolean inline, Optional<String> filename, FileMimeTypes fileMimeTypes)
Generates a 401 Unauthorized result.static Result
unauthorized(File content, boolean inline, FileMimeTypes fileMimeTypes)
Generates a 401 Unauthorized result.static Result
unauthorized(File content, String filename)
Deprecated.Deprecated as of 2.8.0.static Result
unauthorized(File content, String filename, FileMimeTypes fileMimeTypes)
Deprecated.Deprecated as of 2.8.0.static Result
unauthorized(File content, Optional<String> filename)
Generates a 401 Unauthorized result.static Result
unauthorized(File content, Optional<String> filename, FileMimeTypes fileMimeTypes)
Generates a 401 Unauthorized result.static Result
unauthorized(File content, FileMimeTypes fileMimeTypes)
Generates a 401 Unauthorized result.static Result
unauthorized(InputStream content)
Generates a 401 Unauthorized result.static Result
unauthorized(InputStream content, long contentLength)
Generates a 401 Unauthorized result.static Result
unauthorized(String content)
Generates a 401 Unauthorized result.static Result
unauthorized(String content, String charset)
Generates a 401 Unauthorized result.static Result
unauthorized(Path content)
Generates a 401 Unauthorized result.static Result
unauthorized(Path content, boolean inline)
Generates a 401 Unauthorized result.static Result
unauthorized(Path content, boolean inline, Optional<String> filename)
Generates a 401 Unauthorized result.static Result
unauthorized(Path content, boolean inline, Optional<String> filename, FileMimeTypes fileMimeTypes)
Generates a 401 Unauthorized result.static Result
unauthorized(Path content, boolean inline, FileMimeTypes fileMimeTypes)
Generates a 401 Unauthorized result.static Result
unauthorized(Path content, Optional<String> filename)
Generates a 401 Unauthorized result.static Result
unauthorized(Path content, Optional<String> filename, FileMimeTypes fileMimeTypes)
Generates a 401 Unauthorized result.static Result
unauthorized(Path content, FileMimeTypes fileMimeTypes)
Generates a 401 Unauthorized result.static Result
unauthorized(play.twirl.api.Content content)
Generates a 401 Unauthorized result.static Result
unauthorized(play.twirl.api.Content content, String charset)
Generates a 401 Unauthorized result.static StatusHeader
unsupportedMediaType()
Generates a 415 Unsupported Media Type result.static Result
unsupportedMediaType(byte[] content)
Generates a 415 Unsupported Media Type result.static Result
unsupportedMediaType(com.fasterxml.jackson.databind.JsonNode content)
Generates a 415 Unsupported Media Type result.static Result
unsupportedMediaType(com.fasterxml.jackson.databind.JsonNode content, com.fasterxml.jackson.core.JsonEncoding encoding)
Generates a 415 Unsupported Media Type result.static Result
unsupportedMediaType(File content)
Generates a 415 Unsupported Media Type result.static Result
unsupportedMediaType(File content, boolean inline)
Generates a 415 Unsupported Media Type result.static Result
unsupportedMediaType(File content, boolean inline, Optional<String> filename)
Generates a 415 Unsupported Media Type result.static Result
unsupportedMediaType(File content, boolean inline, Optional<String> filename, FileMimeTypes fileMimeTypes)
Generates a 415 Unsupported Media Type result.static Result
unsupportedMediaType(File content, boolean inline, FileMimeTypes fileMimeTypes)
Generates a 415 Unsupported Media Type result.static Result
unsupportedMediaType(File content, String filename)
Deprecated.Deprecated as of 2.8.0.static Result
unsupportedMediaType(File content, String filename, FileMimeTypes fileMimeTypes)
Deprecated.Deprecated as of 2.8.0.static Result
unsupportedMediaType(File content, Optional<String> filename)
Generates a 415 Unsupported Media Type result.static Result
unsupportedMediaType(File content, Optional<String> filename, FileMimeTypes fileMimeTypes)
Generates a 415 Unsupported Media Type result.static Result
unsupportedMediaType(File content, FileMimeTypes fileMimeTypes)
Generates a 415 Unsupported Media Type result.static Result
unsupportedMediaType(InputStream content)
Generates a 415 Unsupported Media Type result.static Result
unsupportedMediaType(InputStream content, long contentLength)
Generates a 415 Unsupported Media Type result.static Result
unsupportedMediaType(String content)
Generates a 415 Unsupported Media Type result.static Result
unsupportedMediaType(String content, String charset)
Generates a 415 Unsupported Media Type result.static Result
unsupportedMediaType(Path content)
Generates a 415 Unsupported Media Type result.static Result
unsupportedMediaType(Path content, boolean inline)
Generates a 415 Unsupported Media Type result.static Result
unsupportedMediaType(Path content, boolean inline, Optional<String> filename)
Generates a 415 Unsupported Media Type result.static Result
unsupportedMediaType(Path content, boolean inline, Optional<String> filename, FileMimeTypes fileMimeTypes)
Generates a 415 Unsupported Media Type result.static Result
unsupportedMediaType(Path content, boolean inline, FileMimeTypes fileMimeTypes)
Generates a 415 Unsupported Media Type result.static Result
unsupportedMediaType(Path content, Optional<String> filename)
Generates a 415 Unsupported Media Type result.static Result
unsupportedMediaType(Path content, Optional<String> filename, FileMimeTypes fileMimeTypes)
Generates a 415 Unsupported Media Type result.static Result
unsupportedMediaType(Path content, FileMimeTypes fileMimeTypes)
Generates a 415 Unsupported Media Type result.static Result
unsupportedMediaType(play.twirl.api.Content content)
Generates a 415 Unsupported Media Type result.static Result
unsupportedMediaType(play.twirl.api.Content content, String charset)
Generates a 415 Unsupported Media Type result.
-
-
-
Method Detail
-
contentDispositionHeader
public static Map<String,String> contentDispositionHeader(boolean inline, Optional<String> name)
Creates aContent-Disposition
header.
According to RFC 6266 (Section 4.2) there is no need to send the header"Content-Disposition: inline"
. Therefore if the header generated by this method ends up being exactly that header (when passinginline = true
andOptional.empty()
asname
), an empty Map ist returned.- Parameters:
inline
- If the content should be rendered inline or as attachment.name
- The name of the resource, usually displayed in a file download dialog.- Returns:
- a map with a
Content-Disposition
header entry or an empty map if explained conditions apply. - See Also:
- RFC 6266, Section 4.2
-
status
public static StatusHeader status(int status)
Generates a simple result.- Parameters:
status
- the HTTP status for this result e.g. 200 (OK), 404 (NOT_FOUND)- Returns:
- the header-only result
-
status
public static Result status(int status, play.twirl.api.Content content)
Generates a simple result.- Parameters:
status
- the HTTP status for this result e.g. 200 (OK), 404 (NOT_FOUND)content
- the result's body content- Returns:
- the result
-
status
public static Result status(int status, play.twirl.api.Content content, String charset)
Generates a simple result.- Parameters:
status
- the HTTP status for this result e.g. 200 (OK), 404 (NOT_FOUND)content
- the result's body contentcharset
- the charset to encode the content with (e.g. "UTF-8")- Returns:
- the result
-
status
public static Result status(int status, String content)
Generates a simple result.- Parameters:
status
- the HTTP status for this result e.g. 200 (OK), 404 (NOT_FOUND)content
- the result's body content. It will be encoded as a UTF-8 string.- Returns:
- the result
-
status
public static Result status(int status, String content, String charset)
Generates a simple result.- Parameters:
status
- the HTTP status for this result e.g. 200 (OK), 404 (NOT_FOUND)content
- the result's body content.charset
- the charset in which to encode the content (e.g. "UTF-8")- Returns:
- the result
-
status
public static Result status(int status, com.fasterxml.jackson.databind.JsonNode content)
Generates a simple result with json content and UTF8 encoding.- Parameters:
status
- the HTTP status for this result e.g. 200 (OK), 404 (NOT_FOUND)content
- the result's body content as a play-json object- Returns:
- the result
-
status
public static Result status(int status, com.fasterxml.jackson.databind.JsonNode content, com.fasterxml.jackson.core.JsonEncoding encoding)
Generates a simple result with json content.- Parameters:
status
- the HTTP status for this result e.g. 200 (OK), 404 (NOT_FOUND)content
- the result's body content, as a play-json objectencoding
- the encoding into which the json should be encoded- Returns:
- the result
-
status
public static Result status(int status, byte[] content)
Generates a simple result with byte-array content.- Parameters:
status
- the HTTP status for this result e.g. 200 (OK), 404 (NOT_FOUND)content
- the result's body content, as a byte array- Returns:
- the result
-
status
public static Result status(int status, ByteString content)
Generates a simple result.- Parameters:
status
- the HTTP status for this result e.g. 200 (OK), 404 (NOT_FOUND)content
- the result's body content- Returns:
- the result
-
status
public static Result status(int status, InputStream content)
Generates a chunked result.- Parameters:
status
- the HTTP status for this result e.g. 200 (OK), 404 (NOT_FOUND)content
- the input stream containing data to chunk over- Returns:
- the result
-
status
public static Result status(int status, InputStream content, long contentLength)
Generates a chunked result.- Parameters:
status
- the HTTP status for this result e.g. 200 (OK), 404 (NOT_FOUND)content
- the input stream containing data to chunk overcontentLength
- the length of the provided content in bytes.- Returns:
- the result
-
status
public static Result status(int status, File content)
Generates a result with file contents.- Parameters:
status
- the HTTP status for this result e.g. 200 (OK), 404 (NOT_FOUND)content
- the file to send- Returns:
- the result
-
status
public static Result status(int status, File content, FileMimeTypes fileMimeTypes)
Generates a result with file contents.- Parameters:
status
- the HTTP status for this result e.g. 200 (OK), 404 (NOT_FOUND)content
- the file to sendfileMimeTypes
- Used for file type mapping.- Returns:
- the result
-
status
public static Result status(int status, File content, boolean inline)
Generates a result with file content.- Parameters:
status
- the HTTP status for this result e.g. 200 (OK), 404 (NOT_FOUND)content
- the file to sendinline
-true
to have it sent with inline Content-Disposition.- Returns:
- the result
-
status
public static Result status(int status, File content, boolean inline, FileMimeTypes fileMimeTypes)
Generates a result with file content.- Parameters:
status
- the HTTP status for this result e.g. 200 (OK), 404 (NOT_FOUND)content
- the file to sendinline
-true
to have it sent with inline Content-Disposition.fileMimeTypes
- Used for file type mapping.- Returns:
- the result
-
status
@Deprecated public static Result status(int status, File content, String fileName)
Deprecated.Deprecated as of 2.8.0. Use tostatus(int, File, Optional)
.Generates a result.- Parameters:
status
- the HTTP status for this result e.g. 200 (OK), 404 (NOT_FOUND)content
- the file to sendfileName
- the name that the client should receive this file as- Returns:
- the result
-
status
public static Result status(int status, File content, Optional<String> fileName)
Generates a result.- Parameters:
status
- the HTTP status for this result e.g. 200 (OK), 404 (NOT_FOUND)content
- the file to sendfileName
- the name that the client should receive this file as- Returns:
- the result
-
status
@Deprecated public static Result status(int status, File content, String fileName, FileMimeTypes fileMimeTypes)
Deprecated.Deprecated as of 2.8.0. Use tostatus(int, File, Optional, FileMimeTypes)
.Generates a result.- Parameters:
status
- the HTTP status for this result e.g. 200 (OK), 404 (NOT_FOUND)content
- the file to sendfileName
- the name that the client should receive this file asfileMimeTypes
- Used for file type mapping.- Returns:
- the result
-
status
public static Result status(int status, File content, Optional<String> fileName, FileMimeTypes fileMimeTypes)
Generates a result.- Parameters:
status
- the HTTP status for this result e.g. 200 (OK), 404 (NOT_FOUND)content
- the file to sendfileName
- the name that the client should receive this file asfileMimeTypes
- Used for file type mapping.- Returns:
- the result
-
status
public static Result status(int status, File content, boolean inline, Optional<String> fileName)
Generates a result.- Parameters:
status
- the HTTP status for this result e.g. 200 (OK), 404 (NOT_FOUND)content
- the file to sendinline
-true
to have it sent with inline Content-Disposition.fileName
- the name that the client should receive this file as- Returns:
- the result
-
status
public static Result status(int status, File content, boolean inline, Optional<String> fileName, FileMimeTypes fileMimeTypes)
Generates a result.- Parameters:
status
- the HTTP status for this result e.g. 200 (OK), 404 (NOT_FOUND)content
- the file to sendinline
-true
to have it sent with inline Content-Disposition.fileName
- the name that the client should receive this file asfileMimeTypes
- Used for file type mapping.- Returns:
- the result
-
status
public static Result status(int status, Path content)
Generates a result with path contents.- Parameters:
status
- the HTTP status for this result e.g. 200 (OK), 404 (NOT_FOUND)content
- the path to send- Returns:
- the result
-
status
public static Result status(int status, Path content, FileMimeTypes fileMimeTypes)
Generates a result with path contents.- Parameters:
status
- the HTTP status for this result e.g. 200 (OK), 404 (NOT_FOUND)content
- the path to sendfileMimeTypes
- Used for file type mapping.- Returns:
- the result
-
status
public static Result status(int status, Path content, boolean inline)
Generates a result with path content.- Parameters:
status
- the HTTP status for this result e.g. 200 (OK), 404 (NOT_FOUND)content
- the path to sendinline
-true
to have it sent with inline Content-Disposition.- Returns:
- the result
-
status
public static Result status(int status, Path content, boolean inline, FileMimeTypes fileMimeTypes)
Generates a result with path content.- Parameters:
status
- the HTTP status for this result e.g. 200 (OK), 404 (NOT_FOUND)content
- the path to sendinline
-true
to have it sent with inline Content-Disposition.fileMimeTypes
- Used for file type mapping.- Returns:
- the result
-
status
public static Result status(int status, Path content, Optional<String> fileName)
Generates a result.- Parameters:
status
- the HTTP status for this result e.g. 200 (OK), 404 (NOT_FOUND)content
- the path to sendfileName
- the name that the client should receive this path as- Returns:
- the result
-
status
public static Result status(int status, Path content, Optional<String> fileName, FileMimeTypes fileMimeTypes)
Generates a result.- Parameters:
status
- the HTTP status for this result e.g. 200 (OK), 404 (NOT_FOUND)content
- the path to sendfileName
- the name that the client should receive this path asfileMimeTypes
- Used for file type mapping.- Returns:
- the result
-
status
public static Result status(int status, Path content, boolean inline, Optional<String> fileName)
Generates a result.- Parameters:
status
- the HTTP status for this result e.g. 200 (OK), 404 (NOT_FOUND)content
- the path to sendinline
-true
to have it sent with inline Content-Disposition.fileName
- the name that the client should receive this path as- Returns:
- the result
-
status
public static Result status(int status, Path content, boolean inline, Optional<String> fileName, FileMimeTypes fileMimeTypes)
Generates a result.- Parameters:
status
- the HTTP status for this result e.g. 200 (OK), 404 (NOT_FOUND)content
- the path to sendinline
-true
to have it sent with inline Content-Disposition.fileName
- the name that the client should receive this path asfileMimeTypes
- Used for file type mapping.- Returns:
- the result
-
noContent
public static StatusHeader noContent()
Generates a 204 No Content result.- Returns:
- the result
-
ok
public static StatusHeader ok()
Generates a 200 OK result.- Returns:
- the result
-
ok
public static Result ok(play.twirl.api.Content content)
Generates a 200 OK result.- Parameters:
content
- the HTTP response body- Returns:
- the result
-
ok
public static Result ok(play.twirl.api.Content content, String charset)
Generates a 200 OK result.- Parameters:
content
- the HTTP response bodycharset
- the charset into which the content should be encoded (e.g. "UTF-8")- Returns:
- the result
-
ok
public static Result ok(String content)
Generates a 200 OK result.- Parameters:
content
- HTTP response body, encoded as a UTF-8 string- Returns:
- the result
-
ok
public static Result ok(String content, String charset)
Generates a 200 OK result.- Parameters:
content
- the HTTP response bodycharset
- the charset into which the content should be encoded (e.g. "UTF-8")- Returns:
- the result
-
ok
public static Result ok(com.fasterxml.jackson.databind.JsonNode content)
Generates a 200 OK result.- Parameters:
content
- the result's body content as a play-json object. It will be encoded as a UTF-8 string.- Returns:
- the result
-
ok
public static Result ok(com.fasterxml.jackson.databind.JsonNode content, com.fasterxml.jackson.core.JsonEncoding encoding)
Generates a 200 OK result.- Parameters:
content
- the result's body content as a play-json objectencoding
- the encoding into which the json should be encoded- Returns:
- the result
-
ok
public static Result ok(byte[] content)
Generates a 200 OK result.- Parameters:
content
- the result's body content- Returns:
- the result
-
ok
public static Result ok(InputStream content)
Generates a 200 OK result.- Parameters:
content
- the input stream containing data to chunk over- Returns:
- the result
-
ok
public static Result ok(InputStream content, long contentLength)
Generates a 200 OK result.- Parameters:
content
- the input stream containing data to chunk overcontentLength
- the length of the provided content in bytes.- Returns:
- the result
-
ok
public static Result ok(File content)
Generates a 200 OK result.- Parameters:
content
- The file to send.- Returns:
- the result
-
ok
public static Result ok(File content, FileMimeTypes fileMimeTypes)
Generates a 200 OK result.- Parameters:
content
- The file to send.fileMimeTypes
- Used for file type mapping.- Returns:
- the result
-
ok
public static Result ok(File content, boolean inline)
Generates a 200 OK result.- Parameters:
content
- The file to send.inline
- Whether the file should be sent inline, or as an attachment.- Returns:
- the result
-
ok
public static Result ok(File content, boolean inline, FileMimeTypes fileMimeTypes)
Generates a 200 OK result.- Parameters:
content
- The file to send.inline
- Whether the file should be sent inline, or as an attachment.fileMimeTypes
- Used for file type mapping.- Returns:
- the result
-
ok
@Deprecated public static Result ok(File content, String filename)
Deprecated.Deprecated as of 2.8.0. Use took(File, Optional)
.Generates a 200 OK result.- Parameters:
content
- The file to send.filename
- The name to send the file as.- Returns:
- the result
-
ok
public static Result ok(File content, Optional<String> filename)
Generates a 200 OK result.- Parameters:
content
- The file to send.filename
- The name to send the file as.- Returns:
- the result
-
ok
@Deprecated public static Result ok(File content, String filename, FileMimeTypes fileMimeTypes)
Deprecated.Deprecated as of 2.8.0. Use took(File, Optional, FileMimeTypes)
.Generates a 200 OK result.- Parameters:
content
- The file to send.filename
- The name to send the file as.fileMimeTypes
- Used for file type mapping.- Returns:
- the result
-
ok
public static Result ok(File content, Optional<String> filename, FileMimeTypes fileMimeTypes)
Generates a 200 OK result.- Parameters:
content
- The file to send.filename
- The name to send the file as.fileMimeTypes
- Used for file type mapping.- Returns:
- the result
-
ok
public static Result ok(File content, boolean inline, Optional<String> filename)
Generates a 200 OK result.- Parameters:
content
- The file to send.inline
- Whether the file should be sent inline, or as an attachment.filename
- The name to send the file as.- Returns:
- the result
-
ok
public static Result ok(File content, boolean inline, Optional<String> filename, FileMimeTypes fileMimeTypes)
Generates a 200 OK result.- Parameters:
content
- The file to send.inline
- Whether the file should be sent inline, or as an attachment.filename
- The name to send the file as.fileMimeTypes
- Used for file type mapping.- Returns:
- the result
-
ok
public static Result ok(Path content)
Generates a 200 OK result.- Parameters:
content
- The path to send.- Returns:
- the result
-
ok
public static Result ok(Path content, FileMimeTypes fileMimeTypes)
Generates a 200 OK result.- Parameters:
content
- The path to send.fileMimeTypes
- Used for file type mapping.- Returns:
- the result
-
ok
public static Result ok(Path content, boolean inline)
Generates a 200 OK result.- Parameters:
content
- The path to send.inline
- Whether the file should be sent inline, or as an attachment.- Returns:
- the result
-
ok
public static Result ok(Path content, boolean inline, FileMimeTypes fileMimeTypes)
Generates a 200 OK result.- Parameters:
content
- The path to send.inline
- Whether the file should be sent inline, or as an attachment.fileMimeTypes
- Used for file type mapping.- Returns:
- the result
-
ok
public static Result ok(Path content, Optional<String> filename)
Generates a 200 OK result.- Parameters:
content
- The path to send.filename
- The name to send the file as.- Returns:
- the result
-
ok
public static Result ok(Path content, Optional<String> filename, FileMimeTypes fileMimeTypes)
Generates a 200 OK result.- Parameters:
content
- The path to send.filename
- The name to send the file as.fileMimeTypes
- Used for file type mapping.- Returns:
- the result
-
ok
public static Result ok(Path content, boolean inline, Optional<String> filename)
Generates a 200 OK result.- Parameters:
content
- The path to send.inline
- Whether the file should be sent inline, or as an attachment.filename
- The name to send the file as.- Returns:
- the result
-
ok
public static Result ok(Path content, boolean inline, Optional<String> filename, FileMimeTypes fileMimeTypes)
Generates a 200 OK result.- Parameters:
content
- The path to send.inline
- Whether the file should be sent inline, or as an attachment.filename
- The name to send the file as.fileMimeTypes
- Used for file type mapping.- Returns:
- the result
-
created
public static StatusHeader created()
Generates a 201 Created result.- Returns:
- the result
-
created
public static Result created(play.twirl.api.Content content)
Generates a 201 Created result.- Parameters:
content
- the HTTP response body- Returns:
- the result
-
created
public static Result created(play.twirl.api.Content content, String charset)
Generates a 201 Created result.- Parameters:
content
- the HTTP response bodycharset
- the charset into which the content should be encoded (e.g. "UTF-8")- Returns:
- the result
-
created
public static Result created(String content)
Generates a 201 Created result.- Parameters:
content
- HTTP response body, encoded as a UTF-8 string- Returns:
- the result
-
created
public static Result created(String content, String charset)
Generates a 201 Created result.- Parameters:
content
- the HTTP response bodycharset
- the charset into which the content should be encoded (e.g. "UTF-8")- Returns:
- the result
-
created
public static Result created(com.fasterxml.jackson.databind.JsonNode content)
Generates a 201 Created result.- Parameters:
content
- the result's body content as a play-json object. It will be encoded as a UTF-8 string.- Returns:
- the result
-
created
public static Result created(com.fasterxml.jackson.databind.JsonNode content, com.fasterxml.jackson.core.JsonEncoding encoding)
Generates a 201 Created result.- Parameters:
content
- the result's body content as a play-json objectencoding
- the encoding into which the json should be encoded- Returns:
- the result
-
created
public static Result created(byte[] content)
Generates a 201 Created result.- Parameters:
content
- the result's body content- Returns:
- the result
-
created
public static Result created(InputStream content)
Generates a 201 Created result.- Parameters:
content
- the input stream containing data to chunk over- Returns:
- the result
-
created
public static Result created(InputStream content, long contentLength)
Generates a 201 Created result.- Parameters:
content
- the input stream containing data to chunk overcontentLength
- the length of the provided content in bytes.- Returns:
- the result
-
created
public static Result created(File content)
Generates a 201 Created result.- Parameters:
content
- The file to send.- Returns:
- the result
-
created
public static Result created(File content, FileMimeTypes fileMimeTypes)
Generates a 201 Created result.- Parameters:
content
- The file to send.fileMimeTypes
- Used for file type mapping.- Returns:
- the result
-
created
public static Result created(File content, boolean inline)
Generates a 201 Created result.- Parameters:
content
- The file to send.inline
- Whether the file should be sent inline, or as an attachment.- Returns:
- the result
-
created
public static Result created(File content, boolean inline, FileMimeTypes fileMimeTypes)
Generates a 201 Created result.- Parameters:
content
- The file to send.inline
- Whether the file should be sent inline, or as an attachment.fileMimeTypes
- Used for file type mapping.- Returns:
- the result
-
created
@Deprecated public static Result created(File content, String filename)
Deprecated.Deprecated as of 2.8.0. Use tocreated(File, Optional)
.Generates a 201 Created result.- Parameters:
content
- The file to send.filename
- The name to send the file as.- Returns:
- the result
-
created
public static Result created(File content, Optional<String> filename)
Generates a 201 Created result.- Parameters:
content
- The file to send.filename
- The name to send the file as.- Returns:
- the result
-
created
@Deprecated public static Result created(File content, String filename, FileMimeTypes fileMimeTypes)
Deprecated.Deprecated as of 2.8.0. Use tocreated(File, Optional, FileMimeTypes)
.Generates a 201 Created result.- Parameters:
content
- The file to send.filename
- The name to send the file as.fileMimeTypes
- Used for file type mapping.- Returns:
- the result
-
created
public static Result created(File content, Optional<String> filename, FileMimeTypes fileMimeTypes)
Generates a 201 Created result.- Parameters:
content
- The file to send.filename
- The name to send the file as.fileMimeTypes
- Used for file type mapping.- Returns:
- the result
-
created
public static Result created(File content, boolean inline, Optional<String> filename)
Generates a 201 Created result.- Parameters:
content
- The file to send.inline
- Whether the file should be sent inline, or as an attachment.filename
- The name to send the file as.- Returns:
- the result
-
created
public static Result created(File content, boolean inline, Optional<String> filename, FileMimeTypes fileMimeTypes)
Generates a 201 Created result.- Parameters:
content
- The file to send.inline
- Whether the file should be sent inline, or as an attachment.filename
- The name to send the file as.fileMimeTypes
- Used for file type mapping.- Returns:
- the result
-
created
public static Result created(Path content)
Generates a 201 Created result.- Parameters:
content
- The path to send.- Returns:
- the result
-
created
public static Result created(Path content, FileMimeTypes fileMimeTypes)
Generates a 201 Created result.- Parameters:
content
- The path to send.fileMimeTypes
- Used for file type mapping.- Returns:
- the result
-
created
public static Result created(Path content, boolean inline)
Generates a 201 Created result.- Parameters:
content
- The path to send.inline
- Whether the file should be sent inline, or as an attachment.- Returns:
- the result
-
created
public static Result created(Path content, boolean inline, FileMimeTypes fileMimeTypes)
Generates a 201 Created result.- Parameters:
content
- The path to send.inline
- Whether the file should be sent inline, or as an attachment.fileMimeTypes
- Used for file type mapping.- Returns:
- the result
-
created
public static Result created(Path content, Optional<String> filename)
Generates a 201 Created result.- Parameters:
content
- The path to send.filename
- The name to send the file as.- Returns:
- the result
-
created
public static Result created(Path content, Optional<String> filename, FileMimeTypes fileMimeTypes)
Generates a 201 Created result.- Parameters:
content
- The path to send.filename
- The name to send the file as.fileMimeTypes
- Used for file type mapping.- Returns:
- the result
-
created
public static Result created(Path content, boolean inline, Optional<String> filename)
Generates a 201 Created result.- Parameters:
content
- The path to send.inline
- Whether the file should be sent inline, or as an attachment.filename
- The name to send the file as.- Returns:
- the result
-
created
public static Result created(Path content, boolean inline, Optional<String> filename, FileMimeTypes fileMimeTypes)
Generates a 201 Created result.- Parameters:
content
- The path to send.inline
- Whether the file should be sent inline, or as an attachment.filename
- The name to send the file as.fileMimeTypes
- Used for file type mapping.- Returns:
- the result
-
badRequest
public static StatusHeader badRequest()
Generates a 400 Bad Request result.- Returns:
- the result
-
badRequest
public static Result badRequest(play.twirl.api.Content content)
Generates a 400 Bad Request result.- Parameters:
content
- the HTTP response body- Returns:
- the result
-
badRequest
public static Result badRequest(play.twirl.api.Content content, String charset)
Generates a 400 Bad Request result.- Parameters:
content
- the HTTP response bodycharset
- the charset into which the content should be encoded (e.g. "UTF-8")- Returns:
- the result
-
badRequest
public static Result badRequest(String content)
Generates a 400 Bad Request result.- Parameters:
content
- HTTP response body, encoded as a UTF-8 string- Returns:
- the result
-
badRequest
public static Result badRequest(String content, String charset)
Generates a 400 Bad Request result.- Parameters:
content
- the HTTP response bodycharset
- the charset into which the content should be encoded (e.g. "UTF-8")- Returns:
- the result
-
badRequest
public static Result badRequest(com.fasterxml.jackson.databind.JsonNode content)
Generates a 400 Bad Request result.- Parameters:
content
- the result's body content as a play-json object. It will be encoded as a UTF-8 string.- Returns:
- the result
-
badRequest
public static Result badRequest(com.fasterxml.jackson.databind.JsonNode content, com.fasterxml.jackson.core.JsonEncoding encoding)
Generates a 400 Bad Request result.- Parameters:
content
- the result's body content as a play-json objectencoding
- the encoding into which the json should be encoded- Returns:
- the result
-
badRequest
public static Result badRequest(byte[] content)
Generates a 400 Bad Request result.- Parameters:
content
- the result's body content- Returns:
- the result
-
badRequest
public static Result badRequest(InputStream content)
Generates a 400 Bad Request result.- Parameters:
content
- the input stream containing data to chunk over- Returns:
- the result
-
badRequest
public static Result badRequest(InputStream content, long contentLength)
Generates a 400 Bad Request result.- Parameters:
content
- the input stream containing data to chunk overcontentLength
- the length of the provided content in bytes.- Returns:
- the result
-
badRequest
public static Result badRequest(File content)
Generates a 400 Bad Request result.- Parameters:
content
- The file to send.- Returns:
- the result
-
badRequest
public static Result badRequest(File content, FileMimeTypes fileMimeTypes)
Generates a 400 Bad Request result.- Parameters:
content
- The file to send.fileMimeTypes
- Used for file type mapping.- Returns:
- the result
-
badRequest
public static Result badRequest(File content, boolean inline)
Generates a 400 Bad Request result.- Parameters:
content
- The file to send.inline
- Whether the file should be sent inline, or as an attachment.- Returns:
- the result
-
badRequest
public static Result badRequest(File content, boolean inline, FileMimeTypes fileMimeTypes)
Generates a 400 Bad Request result.- Parameters:
content
- The file to send.inline
- Whether the file should be sent inline, or as an attachment.fileMimeTypes
- Used for file type mapping.- Returns:
- the result
-
badRequest
@Deprecated public static Result badRequest(File content, String filename)
Deprecated.Deprecated as of 2.8.0. Use tobadRequest(File, Optional)
.Generates a 400 Bad Request result.- Parameters:
content
- The file to send.filename
- The name to send the file as.- Returns:
- the result
-
badRequest
public static Result badRequest(File content, Optional<String> filename)
Generates a 400 Bad Request result.- Parameters:
content
- The file to send.filename
- The name to send the file as.- Returns:
- the result
-
badRequest
@Deprecated public static Result badRequest(File content, String filename, FileMimeTypes fileMimeTypes)
Deprecated.Deprecated as of 2.8.0. Use tobadRequest(File, Optional, FileMimeTypes)
.Generates a 400 Bad Request result.- Parameters:
content
- The file to send.filename
- The name to send the file as.fileMimeTypes
- Used for file type mapping.- Returns:
- the result
-
badRequest
public static Result badRequest(File content, Optional<String> filename, FileMimeTypes fileMimeTypes)
Generates a 400 Bad Request result.- Parameters:
content
- The file to send.filename
- The name to send the file as.fileMimeTypes
- Used for file type mapping.- Returns:
- the result
-
badRequest
public static Result badRequest(File content, boolean inline, Optional<String> filename)
Generates a 400 Bad Request result.- Parameters:
content
- The file to send.inline
- Whether the file should be sent inline, or as an attachment.filename
- The name to send the file as.- Returns:
- the result
-
badRequest
public static Result badRequest(File content, boolean inline, Optional<String> filename, FileMimeTypes fileMimeTypes)
Generates a 400 Bad Request result.- Parameters:
content
- The file to send.inline
- Whether the file should be sent inline, or as an attachment.filename
- The name to send the file as.fileMimeTypes
- Used for file type mapping.- Returns:
- the result
-
badRequest
public static Result badRequest(Path content)
Generates a 400 Bad Request result.- Parameters:
content
- The path to send.- Returns:
- the result
-
badRequest
public static Result badRequest(Path content, FileMimeTypes fileMimeTypes)
Generates a 400 Bad Request result.- Parameters:
content
- The path to send.fileMimeTypes
- Used for file type mapping.- Returns:
- the result
-
badRequest
public static Result badRequest(Path content, boolean inline)
Generates a 400 Bad Request result.- Parameters:
content
- The path to send.inline
- Whether the file should be sent inline, or as an attachment.- Returns:
- the result
-
badRequest
public static Result badRequest(Path content, boolean inline, FileMimeTypes fileMimeTypes)
Generates a 400 Bad Request result.- Parameters:
content
- The path to send.inline
- Whether the file should be sent inline, or as an attachment.fileMimeTypes
- Used for file type mapping.- Returns:
- the result
-
badRequest
public static Result badRequest(Path content, Optional<String> filename)
Generates a 400 Bad Request result.- Parameters:
content
- The path to send.filename
- The name to send the file as.- Returns:
- the result
-
badRequest
public static Result badRequest(Path content, Optional<String> filename, FileMimeTypes fileMimeTypes)
Generates a 400 Bad Request result.- Parameters:
content
- The path to send.filename
- The name to send the file as.fileMimeTypes
- Used for file type mapping.- Returns:
- the result
-
badRequest
public static Result badRequest(Path content, boolean inline, Optional<String> filename)
Generates a 400 Bad Request result.- Parameters:
content
- The path to send.inline
- Whether the file should be sent inline, or as an attachment.filename
- The name to send the file as.- Returns:
- the result
-
badRequest
public static Result badRequest(Path content, boolean inline, Optional<String> filename, FileMimeTypes fileMimeTypes)
Generates a 400 Bad Request result.- Parameters:
content
- The path to send.inline
- Whether the file should be sent inline, or as an attachment.filename
- The name to send the file as.fileMimeTypes
- Used for file type mapping.- Returns:
- the result
-
unauthorized
public static StatusHeader unauthorized()
Generates a 401 Unauthorized result.- Returns:
- the result
-
unauthorized
public static Result unauthorized(play.twirl.api.Content content)
Generates a 401 Unauthorized result.- Parameters:
content
- the HTTP response body- Returns:
- the result
-
unauthorized
public static Result unauthorized(play.twirl.api.Content content, String charset)
Generates a 401 Unauthorized result.- Parameters:
content
- the HTTP response bodycharset
- the charset into which the content should be encoded (e.g. "UTF-8")- Returns:
- the result
-
unauthorized
public static Result unauthorized(String content)
Generates a 401 Unauthorized result.- Parameters:
content
- HTTP response body, encoded as a UTF-8 string- Returns:
- the result
-
unauthorized
public static Result unauthorized(String content, String charset)
Generates a 401 Unauthorized result.- Parameters:
content
- the HTTP response bodycharset
- the charset into which the content should be encoded (e.g. "UTF-8")- Returns:
- the result
-
unauthorized
public static Result unauthorized(com.fasterxml.jackson.databind.JsonNode content)
Generates a 401 Unauthorized result.- Parameters:
content
- the result's body content as a play-json object. It will be encoded as a UTF-8 string.- Returns:
- the result
-
unauthorized
public static Result unauthorized(com.fasterxml.jackson.databind.JsonNode content, com.fasterxml.jackson.core.JsonEncoding encoding)
Generates a 401 Unauthorized result.- Parameters:
content
- the result's body content as a play-json objectencoding
- the encoding into which the json should be encoded- Returns:
- the result
-
unauthorized
public static Result unauthorized(byte[] content)
Generates a 401 Unauthorized result.- Parameters:
content
- the result's body content- Returns:
- the result
-
unauthorized
public static Result unauthorized(InputStream content)
Generates a 401 Unauthorized result.- Parameters:
content
- the input stream containing data to chunk over- Returns:
- the result
-
unauthorized
public static Result unauthorized(InputStream content, long contentLength)
Generates a 401 Unauthorized result.- Parameters:
content
- the input stream containing data to chunk overcontentLength
- the length of the provided content in bytes.- Returns:
- the result
-
unauthorized
public static Result unauthorized(File content)
Generates a 401 Unauthorized result.- Parameters:
content
- The file to send.- Returns:
- the result
-
unauthorized
public static Result unauthorized(File content, FileMimeTypes fileMimeTypes)
Generates a 401 Unauthorized result.- Parameters:
content
- The file to send.fileMimeTypes
- Used for file type mapping.- Returns:
- the result
-
unauthorized
public static Result unauthorized(File content, boolean inline)
Generates a 401 Unauthorized result.- Parameters:
content
- The file to send.inline
- Whether the file should be sent inline, or as an attachment.- Returns:
- the result
-
unauthorized
public static Result unauthorized(File content, boolean inline, FileMimeTypes fileMimeTypes)
Generates a 401 Unauthorized result.- Parameters:
content
- The file to send.inline
- Whether the file should be sent inline, or as an attachment.fileMimeTypes
- Used for file type mapping.- Returns:
- the result
-
unauthorized
@Deprecated public static Result unauthorized(File content, String filename)
Deprecated.Deprecated as of 2.8.0. Use tounauthorized(File, Optional)
.Generates a 401 Unauthorized result.- Parameters:
content
- The file to send.filename
- The name to send the file as.- Returns:
- the result
-
unauthorized
public static Result unauthorized(File content, Optional<String> filename)
Generates a 401 Unauthorized result.- Parameters:
content
- The file to send.filename
- The name to send the file as.- Returns:
- the result
-
unauthorized
@Deprecated public static Result unauthorized(File content, String filename, FileMimeTypes fileMimeTypes)
Deprecated.Deprecated as of 2.8.0. Use tounauthorized(File, Optional, FileMimeTypes)
.Generates a 401 Unauthorized result.- Parameters:
content
- The file to send.filename
- The name to send the file as.fileMimeTypes
- Used for file type mapping.- Returns:
- the result
-
unauthorized
public static Result unauthorized(File content, Optional<String> filename, FileMimeTypes fileMimeTypes)
Generates a 401 Unauthorized result.- Parameters:
content
- The file to send.filename
- The name to send the file as.fileMimeTypes
- Used for file type mapping.- Returns:
- the result
-
unauthorized
public static Result unauthorized(File content, boolean inline, Optional<String> filename)
Generates a 401 Unauthorized result.- Parameters:
content
- The file to send.inline
- Whether the file should be sent inline, or as an attachment.filename
- The name to send the file as.- Returns:
- the result
-
unauthorized
public static Result unauthorized(File content, boolean inline, Optional<String> filename, FileMimeTypes fileMimeTypes)
Generates a 401 Unauthorized result.- Parameters:
content
- The file to send.inline
- Whether the file should be sent inline, or as an attachment.filename
- The name to send the file as.fileMimeTypes
- Used for file type mapping.- Returns:
- the result
-
unauthorized
public static Result unauthorized(Path content)
Generates a 401 Unauthorized result.- Parameters:
content
- The path to send.- Returns:
- the result
-
unauthorized
public static Result unauthorized(Path content, FileMimeTypes fileMimeTypes)
Generates a 401 Unauthorized result.- Parameters:
content
- The path to send.fileMimeTypes
- Used for file type mapping.- Returns:
- the result
-
unauthorized
public static Result unauthorized(Path content, boolean inline)
Generates a 401 Unauthorized result.- Parameters:
content
- The path to send.inline
- Whether the file should be sent inline, or as an attachment.- Returns:
- the result
-
unauthorized
public static Result unauthorized(Path content, boolean inline, FileMimeTypes fileMimeTypes)
Generates a 401 Unauthorized result.- Parameters:
content
- The path to send.inline
- Whether the file should be sent inline, or as an attachment.fileMimeTypes
- Used for file type mapping.- Returns:
- the result
-
unauthorized
public static Result unauthorized(Path content, Optional<String> filename)
Generates a 401 Unauthorized result.- Parameters:
content
- The path to send.filename
- The name to send the file as.- Returns:
- the result
-
unauthorized
public static Result unauthorized(Path content, Optional<String> filename, FileMimeTypes fileMimeTypes)
Generates a 401 Unauthorized result.- Parameters:
content
- The path to send.filename
- The name to send the file as.fileMimeTypes
- Used for file type mapping.- Returns:
- the result
-
unauthorized
public static Result unauthorized(Path content, boolean inline, Optional<String> filename)
Generates a 401 Unauthorized result.- Parameters:
content
- The path to send.inline
- Whether the file should be sent inline, or as an attachment.filename
- The name to send the file as.- Returns:
- the result
-
unauthorized
public static Result unauthorized(Path content, boolean inline, Optional<String> filename, FileMimeTypes fileMimeTypes)
Generates a 401 Unauthorized result.- Parameters:
content
- The path to send.inline
- Whether the file should be sent inline, or as an attachment.filename
- The name to send the file as.fileMimeTypes
- Used for file type mapping.- Returns:
- the result
-
paymentRequired
public static StatusHeader paymentRequired()
Generates a 402 Payment Required result.- Returns:
- the result
-
paymentRequired
public static Result paymentRequired(play.twirl.api.Content content)
Generates a 402 Payment Required result.- Parameters:
content
- the HTTP response body- Returns:
- the result
-
paymentRequired
public static Result paymentRequired(play.twirl.api.Content content, String charset)
Generates a 402 Payment Required result.- Parameters:
content
- the HTTP response bodycharset
- the charset into which the content should be encoded (e.g. "UTF-8")- Returns:
- the result
-
paymentRequired
public static Result paymentRequired(String content)
Generates a 402 Payment Required result.- Parameters:
content
- HTTP response body, encoded as a UTF-8 string- Returns:
- the result
-
paymentRequired
public static Result paymentRequired(String content, String charset)
Generates a 402 Payment Required result.- Parameters:
content
- the HTTP response bodycharset
- the charset into which the content should be encoded (e.g. "UTF-8")- Returns:
- the result
-
paymentRequired
public static Result paymentRequired(com.fasterxml.jackson.databind.JsonNode content)
Generates a 402 Payment Required result.- Parameters:
content
- the result's body content as a play-json object. It will be encoded as a UTF-8 string.- Returns:
- the result
-
paymentRequired
public static Result paymentRequired(com.fasterxml.jackson.databind.JsonNode content, com.fasterxml.jackson.core.JsonEncoding encoding)
Generates a 402 Payment Required result.- Parameters:
content
- the result's body content as a play-json objectencoding
- the encoding into which the json should be encoded- Returns:
- the result
-
paymentRequired
public static Result paymentRequired(byte[] content)
Generates a 402 Payment Required result.- Parameters:
content
- the result's body content- Returns:
- the result
-
paymentRequired
public static Result paymentRequired(InputStream content)
Generates a 402 Payment Required result.- Parameters:
content
- the input stream containing data to chunk over- Returns:
- the result
-
paymentRequired
public static Result paymentRequired(InputStream content, long contentLength)
Generates a 402 Payment Required result.- Parameters:
content
- the input stream containing data to chunk overcontentLength
- the length of the provided content in bytes.- Returns:
- the result
-
paymentRequired
public static Result paymentRequired(File content)
Generates a 402 Payment Required result.- Parameters:
content
- The file to send.- Returns:
- the result
-
paymentRequired
public static Result paymentRequired(File content, FileMimeTypes fileMimeTypes)
Generates a 402 Payment Required result.- Parameters:
content
- The file to send.fileMimeTypes
- Used for file type mapping.- Returns:
- the result
-
paymentRequired
public static Result paymentRequired(File content, boolean inline)
Generates a 402 Payment Required result.- Parameters:
content
- The file to send.inline
- Whether the file should be sent inline, or as an attachment.- Returns:
- the result
-
paymentRequired
public static Result paymentRequired(File content, boolean inline, FileMimeTypes fileMimeTypes)
Generates a 402 Payment Required result.- Parameters:
content
- The file to send.inline
- Whether the file should be sent inline, or as an attachment.fileMimeTypes
- Used for file type mapping.- Returns:
- the result
-
paymentRequired
@Deprecated public static Result paymentRequired(File content, String filename)
Deprecated.Deprecated as of 2.8.0. Use topaymentRequired(File, Optional)
.Generates a 402 Payment Required result.- Parameters:
content
- The file to send.filename
- The name to send the file as.- Returns:
- the result
-
paymentRequired
public static Result paymentRequired(File content, Optional<String> filename)
Generates a 402 Payment Required result.- Parameters:
content
- The file to send.filename
- The name to send the file as.- Returns:
- the result
-
paymentRequired
@Deprecated public static Result paymentRequired(File content, String filename, FileMimeTypes fileMimeTypes)
Deprecated.Deprecated as of 2.8.0. Use topaymentRequired(File, Optional, FileMimeTypes)
.Generates a 402 Payment Required result.- Parameters:
content
- The file to send.filename
- The name to send the file as.fileMimeTypes
- Used for file type mapping.- Returns:
- the result
-
paymentRequired
public static Result paymentRequired(File content, Optional<String> filename, FileMimeTypes fileMimeTypes)
Generates a 402 Payment Required result.- Parameters:
content
- The file to send.filename
- The name to send the file as.fileMimeTypes
- Used for file type mapping.- Returns:
- the result
-
paymentRequired
public static Result paymentRequired(File content, boolean inline, Optional<String> filename)
Generates a 402 Payment Required result.- Parameters:
content
- The file to send.inline
- Whether the file should be sent inline, or as an attachment.filename
- The name to send the file as.- Returns:
- the result
-
paymentRequired
public static Result paymentRequired(File content, boolean inline, Optional<String> filename, FileMimeTypes fileMimeTypes)
Generates a 402 Payment Required result.- Parameters:
content
- The file to send.inline
- Whether the file should be sent inline, or as an attachment.filename
- The name to send the file as.fileMimeTypes
- Used for file type mapping.- Returns:
- the result
-
paymentRequired
public static Result paymentRequired(Path content)
Generates a 402 Payment Required result.- Parameters:
content
- The path to send.- Returns:
- the result
-
paymentRequired
public static Result paymentRequired(Path content, FileMimeTypes fileMimeTypes)
Generates a 402 Payment Required result.- Parameters:
content
- The path to send.fileMimeTypes
- Used for file type mapping.- Returns:
- the result
-
paymentRequired
public static Result paymentRequired(Path content, boolean inline)
Generates a 402 Payment Required result.- Parameters:
content
- The path to send.inline
- Whether the file should be sent inline, or as an attachment.- Returns:
- the result
-
paymentRequired
public static Result paymentRequired(Path content, boolean inline, FileMimeTypes fileMimeTypes)
Generates a 402 Payment Required result.- Parameters:
content
- The path to send.inline
- Whether the file should be sent inline, or as an attachment.fileMimeTypes
- Used for file type mapping.- Returns:
- the result
-
paymentRequired
public static Result paymentRequired(Path content, Optional<String> filename)
Generates a 402 Payment Required result.- Parameters:
content
- The path to send.filename
- The name to send the file as.- Returns:
- the result
-
paymentRequired
public static Result paymentRequired(Path content, Optional<String> filename, FileMimeTypes fileMimeTypes)
Generates a 402 Payment Required result.- Parameters:
content
- The path to send.filename
- The name to send the file as.fileMimeTypes
- Used for file type mapping.- Returns:
- the result
-
paymentRequired
public static Result paymentRequired(Path content, boolean inline, Optional<String> filename)
Generates a 402 Payment Required result.- Parameters:
content
- The path to send.inline
- Whether the file should be sent inline, or as an attachment.filename
- The name to send the file as.- Returns:
- the result
-
paymentRequired
public static Result paymentRequired(Path content, boolean inline, Optional<String> filename, FileMimeTypes fileMimeTypes)
Generates a 402 Payment Required result.- Parameters:
content
- The path to send.inline
- Whether the file should be sent inline, or as an attachment.filename
- The name to send the file as.fileMimeTypes
- Used for file type mapping.- Returns:
- the result
-
forbidden
public static StatusHeader forbidden()
Generates a 403 Forbidden result.- Returns:
- the result
-
forbidden
public static Result forbidden(play.twirl.api.Content content)
Generates a 403 Forbidden result.- Parameters:
content
- the HTTP response body- Returns:
- the result
-
forbidden
public static Result forbidden(play.twirl.api.Content content, String charset)
Generates a 403 Forbidden result.- Parameters:
content
- the HTTP response bodycharset
- the charset into which the content should be encoded (e.g. "UTF-8")- Returns:
- the result
-
forbidden
public static Result forbidden(String content)
Generates a 403 Forbidden result.- Parameters:
content
- HTTP response body, encoded as a UTF-8 string- Returns:
- the result
-
forbidden
public static Result forbidden(String content, String charset)
Generates a 403 Forbidden result.- Parameters:
content
- the HTTP response bodycharset
- the charset into which the content should be encoded (e.g. "UTF-8")- Returns:
- the result
-
forbidden
public static Result forbidden(com.fasterxml.jackson.databind.JsonNode content)
Generates a 403 Forbidden result.- Parameters:
content
- the result's body content as a play-json object. It will be encoded as a UTF-8 string.- Returns:
- the result
-
forbidden
public static Result forbidden(com.fasterxml.jackson.databind.JsonNode content, com.fasterxml.jackson.core.JsonEncoding encoding)
Generates a 403 Forbidden result.- Parameters:
content
- the result's body content as a play-json objectencoding
- the encoding into which the json should be encoded- Returns:
- the result
-
forbidden
public static Result forbidden(byte[] content)
Generates a 403 Forbidden result.- Parameters:
content
- the result's body content- Returns:
- the result
-
forbidden
public static Result forbidden(InputStream content)
Generates a 403 Forbidden result.- Parameters:
content
- the input stream containing data to chunk over- Returns:
- the result
-
forbidden
public static Result forbidden(InputStream content, long contentLength)
Generates a 403 Forbidden result.- Parameters:
content
- the input stream containing data to chunk overcontentLength
- the length of the provided content in bytes.- Returns:
- the result
-
forbidden
public static Result forbidden(File content)
Generates a 403 Forbidden result.- Parameters:
content
- The file to send.- Returns:
- the result
-
forbidden
public static Result forbidden(File content, FileMimeTypes fileMimeTypes)
Generates a 403 Forbidden result.- Parameters:
content
- The file to send.fileMimeTypes
- Used for file type mapping.- Returns:
- the result
-
forbidden
public static Result forbidden(File content, boolean inline)
Generates a 403 Forbidden result.- Parameters:
content
- The file to send.inline
- Whether the file should be sent inline, or as an attachment.- Returns:
- the result
-
forbidden
public static Result forbidden(File content, boolean inline, FileMimeTypes fileMimeTypes)
Generates a 403 Forbidden result.- Parameters:
content
- The file to send.inline
- Whether the file should be sent inline, or as an attachment.fileMimeTypes
- Used for file type mapping.- Returns:
- the result
-
forbidden
@Deprecated public static Result forbidden(File content, String filename)
Deprecated.Deprecated as of 2.8.0. Use toforbidden(File, Optional)
.Generates a 403 Forbidden result.- Parameters:
content
- The file to send.filename
- The name to send the file as.- Returns:
- the result
-
forbidden
public static Result forbidden(File content, Optional<String> filename)
Generates a 403 Forbidden result.- Parameters:
content
- The file to send.filename
- The name to send the file as.- Returns:
- the result
-
forbidden
@Deprecated public static Result forbidden(File content, String filename, FileMimeTypes fileMimeTypes)
Deprecated.Deprecated as of 2.8.0. Use toforbidden(File, Optional, FileMimeTypes)
.Generates a 403 Forbidden result.- Parameters:
content
- The file to send.filename
- The name to send the file as.fileMimeTypes
- Used for file type mapping.- Returns:
- the result
-
forbidden
public static Result forbidden(File content, Optional<String> filename, FileMimeTypes fileMimeTypes)
Generates a 403 Forbidden result.- Parameters:
content
- The file to send.filename
- The name to send the file as.fileMimeTypes
- Used for file type mapping.- Returns:
- the result
-
forbidden
public static Result forbidden(File content, boolean inline, Optional<String> filename)
Generates a 403 Forbidden result.- Parameters:
content
- The file to send.inline
- Whether the file should be sent inline, or as an attachment.filename
- The name to send the file as.- Returns:
- the result
-
forbidden
public static Result forbidden(File content, boolean inline, Optional<String> filename, FileMimeTypes fileMimeTypes)
Generates a 403 Forbidden result.- Parameters:
content
- The file to send.inline
- Whether the file should be sent inline, or as an attachment.filename
- The name to send the file as.fileMimeTypes
- Used for file type mapping.- Returns:
- the result
-
forbidden
public static Result forbidden(Path content)
Generates a 403 Forbidden result.- Parameters:
content
- The path to send.- Returns:
- the result
-
forbidden
public static Result forbidden(Path content, FileMimeTypes fileMimeTypes)
Generates a 403 Forbidden result.- Parameters:
content
- The path to send.fileMimeTypes
- Used for file type mapping.- Returns:
- the result
-
forbidden
public static Result forbidden(Path content, boolean inline)
Generates a 403 Forbidden result.- Parameters:
content
- The path to send.inline
- Whether the file should be sent inline, or as an attachment.- Returns:
- the result
-
forbidden
public static Result forbidden(Path content, boolean inline, FileMimeTypes fileMimeTypes)
Generates a 403 Forbidden result.- Parameters:
content
- The path to send.inline
- Whether the file should be sent inline, or as an attachment.fileMimeTypes
- Used for file type mapping.- Returns:
- the result
-
forbidden
public static Result forbidden(Path content, Optional<String> filename)
Generates a 403 Forbidden result.- Parameters:
content
- The path to send.filename
- The name to send the file as.- Returns:
- the result
-
forbidden
public static Result forbidden(Path content, Optional<String> filename, FileMimeTypes fileMimeTypes)
Generates a 403 Forbidden result.- Parameters:
content
- The path to send.filename
- The name to send the file as.fileMimeTypes
- Used for file type mapping.- Returns:
- the result
-
forbidden
public static Result forbidden(Path content, boolean inline, Optional<String> filename)
Generates a 403 Forbidden result.- Parameters:
content
- The path to send.inline
- Whether the file should be sent inline, or as an attachment.filename
- The name to send the file as.- Returns:
- the result
-
forbidden
public static Result forbidden(Path content, boolean inline, Optional<String> filename, FileMimeTypes fileMimeTypes)
Generates a 403 Forbidden result.- Parameters:
content
- The path to send.inline
- Whether the file should be sent inline, or as an attachment.filename
- The name to send the file as.fileMimeTypes
- Used for file type mapping.- Returns:
- the result
-
notFound
public static StatusHeader notFound()
Generates a 404 Not Found result.- Returns:
- the result
-
notFound
public static Result notFound(play.twirl.api.Content content)
Generates a 404 Not Found result.- Parameters:
content
- the HTTP response body- Returns:
- the result
-
notFound
public static Result notFound(play.twirl.api.Content content, String charset)
Generates a 404 Not Found result.- Parameters:
content
- the HTTP response bodycharset
- the charset into which the content should be encoded (e.g. "UTF-8")- Returns:
- the result
-
notFound
public static Result notFound(String content)
Generates a 404 Not Found result.- Parameters:
content
- HTTP response body, encoded as a UTF-8 string- Returns:
- the result
-
notFound
public static Result notFound(String content, String charset)
Generates a 404 Not Found result.- Parameters:
content
- the HTTP response bodycharset
- the charset into which the content should be encoded (e.g. "UTF-8")- Returns:
- the result
-
notFound
public static Result notFound(com.fasterxml.jackson.databind.JsonNode content)
Generates a 404 Not Found result.- Parameters:
content
- the result's body content as a play-json object. It will be encoded as a UTF-8 string.- Returns:
- the result
-
notFound
public static Result notFound(com.fasterxml.jackson.databind.JsonNode content, com.fasterxml.jackson.core.JsonEncoding encoding)
Generates a 404 Not Found result.- Parameters:
content
- the result's body content as a play-json objectencoding
- the encoding into which the json should be encoded- Returns:
- the result
-
notFound
public static Result notFound(byte[] content)
Generates a 404 Not Found result.- Parameters:
content
- the result's body content- Returns:
- the result
-
notFound
public static Result notFound(InputStream content)
Generates a 404 Not Found result.- Parameters:
content
- the input stream containing data to chunk over- Returns:
- the result
-
notFound
public static Result notFound(InputStream content, long contentLength)
Generates a 404 Not Found result.- Parameters:
content
- the input stream containing data to chunk overcontentLength
- the length of the provided content in bytes.- Returns:
- the result
-
notFound
public static Result notFound(File content)
Generates a 404 Not Found result.- Parameters:
content
- The file to send.- Returns:
- the result
-
notFound
public static Result notFound(File content, FileMimeTypes fileMimeTypes)
Generates a 404 Not Found result.- Parameters:
content
- The file to send.fileMimeTypes
- Used for file type mapping.- Returns:
- the result
-
notFound
public static Result notFound(File content, boolean inline)
Generates a 404 Not Found result.- Parameters:
content
- The file to send.inline
- Whether the file should be sent inline, or as an attachment.- Returns:
- the result
-
notFound
public static Result notFound(File content, boolean inline, FileMimeTypes fileMimeTypes)
Generates a 404 Not Found result.- Parameters:
content
- The file to send.inline
- Whether the file should be sent inline, or as an attachment.fileMimeTypes
- Used for file type mapping.- Returns:
- the result
-
notFound
@Deprecated public static Result notFound(File content, String filename)
Deprecated.Deprecated as of 2.8.0. Use tonotFound(File, Optional)
.Generates a 404 Not Found result.- Parameters:
content
- The file to send.filename
- The name to send the file as.- Returns:
- the result
-
notFound
public static Result notFound(File content, Optional<String> filename)
Generates a 404 Not Found result.- Parameters:
content
- The file to send.filename
- The name to send the file as.- Returns:
- the result
-
notFound
@Deprecated public static Result notFound(File content, String filename, FileMimeTypes fileMimeTypes)
Deprecated.Deprecated as of 2.8.0. Use tonotFound(File, Optional, FileMimeTypes)
.Generates a 404 Not Found result.- Parameters:
content
- The file to send.filename
- The name to send the file as.fileMimeTypes
- Used for file type mapping.- Returns:
- the result
-
notFound
public static Result notFound(File content, Optional<String> filename, FileMimeTypes fileMimeTypes)
Generates a 404 Not Found result.- Parameters:
content
- The file to send.filename
- The name to send the file as.fileMimeTypes
- Used for file type mapping.- Returns:
- the result
-
notFound
public static Result notFound(File content, boolean inline, Optional<String> filename)
Generates a 404 Not Found result.- Parameters:
content
- The file to send.inline
- Whether the file should be sent inline, or as an attachment.filename
- The name to send the file as.- Returns:
- the result
-
notFound
public static Result notFound(File content, boolean inline, Optional<String> filename, FileMimeTypes fileMimeTypes)
Generates a 404 Not Found result.- Parameters:
content
- The file to send.inline
- Whether the file should be sent inline, or as an attachment.filename
- The name to send the file as.fileMimeTypes
- Used for file type mapping.- Returns:
- the result
-
notFound
public static Result notFound(Path content)
Generates a 404 Not Found result.- Parameters:
content
- The path to send.- Returns:
- the result
-
notFound
public static Result notFound(Path content, FileMimeTypes fileMimeTypes)
Generates a 404 Not Found result.- Parameters:
content
- The path to send.fileMimeTypes
- Used for file type mapping.- Returns:
- the result
-
notFound
public static Result notFound(Path content, boolean inline)
Generates a 404 Not Found result.- Parameters:
content
- The path to send.inline
- Whether the file should be sent inline, or as an attachment.- Returns:
- the result
-
notFound
public static Result notFound(Path content, boolean inline, FileMimeTypes fileMimeTypes)
Generates a 404 Not Found result.- Parameters:
content
- The path to send.inline
- Whether the file should be sent inline, or as an attachment.fileMimeTypes
- Used for file type mapping.- Returns:
- the result
-
notFound
public static Result notFound(Path content, Optional<String> filename)
Generates a 404 Not Found result.- Parameters:
content
- The path to send.filename
- The name to send the file as.- Returns:
- the result
-
notFound
public static Result notFound(Path content, Optional<String> filename, FileMimeTypes fileMimeTypes)
Generates a 404 Not Found result.- Parameters:
content
- The path to send.filename
- The name to send the file as.fileMimeTypes
- Used for file type mapping.- Returns:
- the result
-
notFound
public static Result notFound(Path content, boolean inline, Optional<String> filename)
Generates a 404 Not Found result.- Parameters:
content
- The path to send.inline
- Whether the file should be sent inline, or as an attachment.filename
- The name to send the file as.- Returns:
- the result
-
notFound
public static Result notFound(Path content, boolean inline, Optional<String> filename, FileMimeTypes fileMimeTypes)
Generates a 404 Not Found result.- Parameters:
content
- The path to send.inline
- Whether the file should be sent inline, or as an attachment.filename
- The name to send the file as.fileMimeTypes
- Used for file type mapping.- Returns:
- the result
-
notAcceptable
public static StatusHeader notAcceptable()
Generates a 406 Not Acceptable result.- Returns:
- the result
-
notAcceptable
public static Result notAcceptable(play.twirl.api.Content content)
Generates a 406 Not Acceptable result.- Parameters:
content
- the HTTP response body- Returns:
- the result
-
notAcceptable
public static Result notAcceptable(play.twirl.api.Content content, String charset)
Generates a 406 Not Acceptable result.- Parameters:
content
- the HTTP response bodycharset
- the charset into which the content should be encoded (e.g. "UTF-8")- Returns:
- the result
-
notAcceptable
public static Result notAcceptable(String content)
Generates a 406 Not Acceptable result.- Parameters:
content
- HTTP response body, encoded as a UTF-8 string- Returns:
- the result
-
notAcceptable
public static Result notAcceptable(String content, String charset)
Generates a 406 Not Acceptable result.- Parameters:
content
- the HTTP response bodycharset
- the charset into which the content should be encoded (e.g. "UTF-8")- Returns:
- the result
-
notAcceptable
public static Result notAcceptable(com.fasterxml.jackson.databind.JsonNode content)
Generates a 406 Not Acceptable result.- Parameters:
content
- the result's body content as a play-json object. It will be encoded as a UTF-8 string.- Returns:
- the result
-
notAcceptable
public static Result notAcceptable(com.fasterxml.jackson.databind.JsonNode content, com.fasterxml.jackson.core.JsonEncoding encoding)
Generates a 406 Not Acceptable result.- Parameters:
content
- the result's body content as a play-json objectencoding
- the encoding into which the json should be encoded- Returns:
- the result
-
notAcceptable
public static Result notAcceptable(byte[] content)
Generates a 406 Not Acceptable result.- Parameters:
content
- the result's body content- Returns:
- the result
-
notAcceptable
public static Result notAcceptable(InputStream content)
Generates a 406 Not Acceptable result.- Parameters:
content
- the input stream containing data to chunk over- Returns:
- the result
-
notAcceptable
public static Result notAcceptable(InputStream content, long contentLength)
Generates a 406 Not Acceptable result.- Parameters:
content
- the input stream containing data to chunk overcontentLength
- the length of the provided content in bytes.- Returns:
- the result
-
notAcceptable
public static Result notAcceptable(File content)
Generates a 406 Not Acceptable result.- Parameters:
content
- The file to send.- Returns:
- the result
-
notAcceptable
public static Result notAcceptable(File content, FileMimeTypes fileMimeTypes)
Generates a 406 Not Acceptable result.- Parameters:
content
- The file to send.fileMimeTypes
- Used for file type mapping.- Returns:
- the result
-
notAcceptable
public static Result notAcceptable(File content, boolean inline)
Generates a 406 Not Acceptable result.- Parameters:
content
- The file to send.inline
- Whether the file should be sent inline, or as an attachment.- Returns:
- the result
-
notAcceptable
public static Result notAcceptable(File content, boolean inline, FileMimeTypes fileMimeTypes)
Generates a 406 Not Acceptable result.- Parameters:
content
- The file to send.inline
- Whether the file should be sent inline, or as an attachment.fileMimeTypes
- Used for file type mapping.- Returns:
- the result
-
notAcceptable
@Deprecated public static Result notAcceptable(File content, String filename)
Deprecated.Deprecated as of 2.8.0. Use tonotAcceptable(File, Optional)
.Generates a 406 Not Acceptable result.- Parameters:
content
- The file to send.filename
- The name to send the file as.- Returns:
- the result
-
notAcceptable
public static Result notAcceptable(File content, Optional<String> filename)
Generates a 406 Not Acceptable result.- Parameters:
content
- The file to send.filename
- The name to send the file as.- Returns:
- the result
-
notAcceptable
@Deprecated public static Result notAcceptable(File content, String filename, FileMimeTypes fileMimeTypes)
Deprecated.Deprecated as of 2.8.0. Use tonotAcceptable(File, Optional, FileMimeTypes)
.Generates a 406 Not Acceptable result.- Parameters:
content
- The file to send.filename
- The name to send the file as.fileMimeTypes
- Used for file type mapping.- Returns:
- the result
-
notAcceptable
public static Result notAcceptable(File content, Optional<String> filename, FileMimeTypes fileMimeTypes)
Generates a 406 Not Acceptable result.- Parameters:
content
- The file to send.filename
- The name to send the file as.fileMimeTypes
- Used for file type mapping.- Returns:
- the result
-
notAcceptable
public static Result notAcceptable(File content, boolean inline, Optional<String> filename)
Generates a 406 Not Acceptable result.- Parameters:
content
- The file to send.inline
- Whether the file should be sent inline, or as an attachment.filename
- The name to send the file as.- Returns:
- the result
-
notAcceptable
public static Result notAcceptable(File content, boolean inline, Optional<String> filename, FileMimeTypes fileMimeTypes)
Generates a 406 Not Acceptable result.- Parameters:
content
- The file to send.inline
- Whether the file should be sent inline, or as an attachment.filename
- The name to send the file as.fileMimeTypes
- Used for file type mapping.- Returns:
- the result
-
notAcceptable
public static Result notAcceptable(Path content)
Generates a 406 Not Acceptable result.- Parameters:
content
- The path to send.- Returns:
- the result
-
notAcceptable
public static Result notAcceptable(Path content, FileMimeTypes fileMimeTypes)
Generates a 406 Not Acceptable result.- Parameters:
content
- The path to send.fileMimeTypes
- Used for file type mapping.- Returns:
- the result
-
notAcceptable
public static Result notAcceptable(Path content, boolean inline)
Generates a 406 Not Acceptable result.- Parameters:
content
- The path to send.inline
- Whether the file should be sent inline, or as an attachment.- Returns:
- the result
-
notAcceptable
public static Result notAcceptable(Path content, boolean inline, FileMimeTypes fileMimeTypes)
Generates a 406 Not Acceptable result.- Parameters:
content
- The path to send.inline
- Whether the file should be sent inline, or as an attachment.fileMimeTypes
- Used for file type mapping.- Returns:
- the result
-
notAcceptable
public static Result notAcceptable(Path content, Optional<String> filename)
Generates a 406 Not Acceptable result.- Parameters:
content
- The path to send.filename
- The name to send the file as.- Returns:
- the result
-
notAcceptable
public static Result notAcceptable(Path content, Optional<String> filename, FileMimeTypes fileMimeTypes)
Generates a 406 Not Acceptable result.- Parameters:
content
- The path to send.filename
- The name to send the file as.fileMimeTypes
- Used for file type mapping.- Returns:
- the result
-
notAcceptable
public static Result notAcceptable(Path content, boolean inline, Optional<String> filename)
Generates a 406 Not Acceptable result.- Parameters:
content
- The path to send.inline
- Whether the file should be sent inline, or as an attachment.filename
- The name to send the file as.- Returns:
- the result
-
notAcceptable
public static Result notAcceptable(Path content, boolean inline, Optional<String> filename, FileMimeTypes fileMimeTypes)
Generates a 406 Not Acceptable result.- Parameters:
content
- The path to send.inline
- Whether the file should be sent inline, or as an attachment.filename
- The name to send the file as.fileMimeTypes
- Used for file type mapping.- Returns:
- the result
-
unsupportedMediaType
public static StatusHeader unsupportedMediaType()
Generates a 415 Unsupported Media Type result.- Returns:
- the result
-
unsupportedMediaType
public static Result unsupportedMediaType(play.twirl.api.Content content)
Generates a 415 Unsupported Media Type result.- Parameters:
content
- the HTTP response body- Returns:
- the result
-
unsupportedMediaType
public static Result unsupportedMediaType(play.twirl.api.Content content, String charset)
Generates a 415 Unsupported Media Type result.- Parameters:
content
- the HTTP response bodycharset
- the charset into which the content should be encoded (e.g. "UTF-8")- Returns:
- the result
-
unsupportedMediaType
public static Result unsupportedMediaType(String content)
Generates a 415 Unsupported Media Type result.- Parameters:
content
- HTTP response body, encoded as a UTF-8 string- Returns:
- the result
-
unsupportedMediaType
public static Result unsupportedMediaType(String content, String charset)
Generates a 415 Unsupported Media Type result.- Parameters:
content
- the HTTP response bodycharset
- the charset into which the content should be encoded (e.g. "UTF-8")- Returns:
- the result
-
unsupportedMediaType
public static Result unsupportedMediaType(com.fasterxml.jackson.databind.JsonNode content)
Generates a 415 Unsupported Media Type result.- Parameters:
content
- the result's body content as a play-json object. It will be encoded as a UTF-8 string.- Returns:
- the result
-
unsupportedMediaType
public static Result unsupportedMediaType(com.fasterxml.jackson.databind.JsonNode content, com.fasterxml.jackson.core.JsonEncoding encoding)
Generates a 415 Unsupported Media Type result.- Parameters:
content
- the result's body content as a play-json objectencoding
- the encoding into which the json should be encoded- Returns:
- the result
-
unsupportedMediaType
public static Result unsupportedMediaType(byte[] content)
Generates a 415 Unsupported Media Type result.- Parameters:
content
- the result's body content- Returns:
- the result
-
unsupportedMediaType
public static Result unsupportedMediaType(InputStream content)
Generates a 415 Unsupported Media Type result.- Parameters:
content
- the input stream containing data to chunk over- Returns:
- the result
-
unsupportedMediaType
public static Result unsupportedMediaType(InputStream content, long contentLength)
Generates a 415 Unsupported Media Type result.- Parameters:
content
- the input stream containing data to chunk overcontentLength
- the length of the provided content in bytes.- Returns:
- the result
-
unsupportedMediaType
public static Result unsupportedMediaType(File content)
Generates a 415 Unsupported Media Type result.- Parameters:
content
- The file to send.- Returns:
- the result
-
unsupportedMediaType
public static Result unsupportedMediaType(File content, FileMimeTypes fileMimeTypes)
Generates a 415 Unsupported Media Type result.- Parameters:
content
- The file to send.fileMimeTypes
- Used for file type mapping.- Returns:
- the result
-
unsupportedMediaType
public static Result unsupportedMediaType(File content, boolean inline)
Generates a 415 Unsupported Media Type result.- Parameters:
content
- The file to send.inline
- Whether the file should be sent inline, or as an attachment.- Returns:
- the result
-
unsupportedMediaType
public static Result unsupportedMediaType(File content, boolean inline, FileMimeTypes fileMimeTypes)
Generates a 415 Unsupported Media Type result.- Parameters:
content
- The file to send.inline
- Whether the file should be sent inline, or as an attachment.fileMimeTypes
- Used for file type mapping.- Returns:
- the result
-
unsupportedMediaType
@Deprecated public static Result unsupportedMediaType(File content, String filename)
Deprecated.Deprecated as of 2.8.0. Use tounsupportedMediaType(File, Optional)
.Generates a 415 Unsupported Media Type result.- Parameters:
content
- The file to send.filename
- The name to send the file as.- Returns:
- the result
-
unsupportedMediaType
public static Result unsupportedMediaType(File content, Optional<String> filename)
Generates a 415 Unsupported Media Type result.- Parameters:
content
- The file to send.filename
- The name to send the file as.- Returns:
- the result
-
unsupportedMediaType
@Deprecated public static Result unsupportedMediaType(File content, String filename, FileMimeTypes fileMimeTypes)
Deprecated.Deprecated as of 2.8.0. Use tounsupportedMediaType(File, Optional, FileMimeTypes)
.Generates a 415 Unsupported Media Type result.- Parameters:
content
- The file to send.filename
- The name to send the file as.fileMimeTypes
- Used for file type mapping.- Returns:
- the result
-
unsupportedMediaType
public static Result unsupportedMediaType(File content, Optional<String> filename, FileMimeTypes fileMimeTypes)
Generates a 415 Unsupported Media Type result.- Parameters:
content
- The file to send.filename
- The name to send the file as.fileMimeTypes
- Used for file type mapping.- Returns:
- the result
-
unsupportedMediaType
public static Result unsupportedMediaType(File content, boolean inline, Optional<String> filename)
Generates a 415 Unsupported Media Type result.- Parameters:
content
- The file to send.inline
- Whether the file should be sent inline, or as an attachment.filename
- The name to send the file as.- Returns:
- the result
-
unsupportedMediaType
public static Result unsupportedMediaType(File content, boolean inline, Optional<String> filename, FileMimeTypes fileMimeTypes)
Generates a 415 Unsupported Media Type result.- Parameters:
content
- The file to send.inline
- Whether the file should be sent inline, or as an attachment.filename
- The name to send the file as.fileMimeTypes
- Used for file type mapping.- Returns:
- the result
-
unsupportedMediaType
public static Result unsupportedMediaType(Path content)
Generates a 415 Unsupported Media Type result.- Parameters:
content
- The path to send.- Returns:
- the result
-
unsupportedMediaType
public static Result unsupportedMediaType(Path content, FileMimeTypes fileMimeTypes)
Generates a 415 Unsupported Media Type result.- Parameters:
content
- The path to send.fileMimeTypes
- Used for file type mapping.- Returns:
- the result
-
unsupportedMediaType
public static Result unsupportedMediaType(Path content, boolean inline)
Generates a 415 Unsupported Media Type result.- Parameters:
content
- The path to send.inline
- Whether the file should be sent inline, or as an attachment.- Returns:
- the result
-
unsupportedMediaType
public static Result unsupportedMediaType(Path content, boolean inline, FileMimeTypes fileMimeTypes)
Generates a 415 Unsupported Media Type result.- Parameters:
content
- The path to send.inline
- Whether the file should be sent inline, or as an attachment.fileMimeTypes
- Used for file type mapping.- Returns:
- the result
-
unsupportedMediaType
public static Result unsupportedMediaType(Path content, Optional<String> filename)
Generates a 415 Unsupported Media Type result.- Parameters:
content
- The path to send.filename
- The name to send the file as.- Returns:
- the result
-
unsupportedMediaType
public static Result unsupportedMediaType(Path content, Optional<String> filename, FileMimeTypes fileMimeTypes)
Generates a 415 Unsupported Media Type result.- Parameters:
content
- The path to send.filename
- The name to send the file as.fileMimeTypes
- Used for file type mapping.- Returns:
- the result
-
unsupportedMediaType
public static Result unsupportedMediaType(Path content, boolean inline, Optional<String> filename)
Generates a 415 Unsupported Media Type result.- Parameters:
content
- The path to send.inline
- Whether the file should be sent inline, or as an attachment.filename
- The name to send the file as.- Returns:
- the result
-
unsupportedMediaType
public static Result unsupportedMediaType(Path content, boolean inline, Optional<String> filename, FileMimeTypes fileMimeTypes)
Generates a 415 Unsupported Media Type result.- Parameters:
content
- The path to send.inline
- Whether the file should be sent inline, or as an attachment.filename
- The name to send the file as.fileMimeTypes
- Used for file type mapping.- Returns:
- the result
-
preconditionRequired
public static StatusHeader preconditionRequired()
Generates a 428 Precondition Required result.- Returns:
- the result
-
preconditionRequired
public static Result preconditionRequired(play.twirl.api.Content content)
Generates a 428 Precondition Required result.- Parameters:
content
- the HTTP response body- Returns:
- the result
-
preconditionRequired
public static Result preconditionRequired(play.twirl.api.Content content, String charset)
Generates a 428 Precondition Required result.- Parameters:
content
- the HTTP response bodycharset
- the charset into which the content should be encoded (e.g. "UTF-8")- Returns:
- the result
-
preconditionRequired
public static Result preconditionRequired(String content)
Generates a 428 Precondition Required result.- Parameters:
content
- HTTP response body, encoded as a UTF-8 string- Returns:
- the result
-
preconditionRequired
public static Result preconditionRequired(String content, String charset)
Generates a 428 Precondition Required result.- Parameters:
content
- the HTTP response bodycharset
- the charset into which the content should be encoded (e.g. "UTF-8")- Returns:
- the result
-
preconditionRequired
public static Result preconditionRequired(com.fasterxml.jackson.databind.JsonNode content)
Generates a 428 Precondition Required result.- Parameters:
content
- the result's body content as a play-json object. It will be encoded as a UTF-8 string.- Returns:
- the result
-
preconditionRequired
public static Result preconditionRequired(com.fasterxml.jackson.databind.JsonNode content, com.fasterxml.jackson.core.JsonEncoding encoding)
Generates a 428 Precondition Required result.- Parameters:
content
- the result's body content as a play-json objectencoding
- the encoding into which the json should be encoded- Returns:
- the result
-
preconditionRequired
public static Result preconditionRequired(byte[] content)
Generates a 428 Precondition Required result.- Parameters:
content
- the result's body content- Returns:
- the result
-
preconditionRequired
public static Result preconditionRequired(InputStream content)
Generates a 428 Precondition Required result.- Parameters:
content
- the input stream containing data to chunk over- Returns:
- the result
-
preconditionRequired
public static Result preconditionRequired(InputStream content, long contentLength)
Generates a 428 Precondition Required result.- Parameters:
content
- the input stream containing data to chunk overcontentLength
- the length of the provided content in bytes.- Returns:
- the result
-
preconditionRequired
public static Result preconditionRequired(File content)
Generates a 428 Precondition Required result.- Parameters:
content
- The file to send.- Returns:
- the result
-
preconditionRequired
public static Result preconditionRequired(File content, FileMimeTypes fileMimeTypes)
Generates a 428 Precondition Required result.- Parameters:
content
- The file to send.fileMimeTypes
- Used for file type mapping.- Returns:
- the result
-
preconditionRequired
public static Result preconditionRequired(File content, boolean inline)
Generates a 428 Precondition Required result.- Parameters:
content
- The file to send.inline
- Whether the file should be sent inline, or as an attachment.- Returns:
- the result
-
preconditionRequired
public static Result preconditionRequired(File content, boolean inline, FileMimeTypes fileMimeTypes)
Generates a 428 Precondition Required result.- Parameters:
content
- The file to send.inline
- Whether the file should be sent inline, or as an attachment.fileMimeTypes
- Used for file type mapping.- Returns:
- the result
-
preconditionRequired
@Deprecated public static Result preconditionRequired(File content, String filename)
Deprecated.Deprecated as of 2.8.0. Use topreconditionRequired(File, Optional)
.Generates a 428 Precondition Required result.- Parameters:
content
- The file to send.filename
- The name to send the file as.- Returns:
- the result
-
preconditionRequired
public static Result preconditionRequired(File content, Optional<String> filename)
Generates a 428 Precondition Required result.- Parameters:
content
- The file to send.filename
- The name to send the file as.- Returns:
- the result
-
preconditionRequired
@Deprecated public static Result preconditionRequired(File content, String filename, FileMimeTypes fileMimeTypes)
Deprecated.Deprecated as of 2.8.0. Use topreconditionRequired(File, Optional, FileMimeTypes)
.Generates a 428 Precondition Required result.- Parameters:
content
- The file to send.filename
- The name to send the file as.fileMimeTypes
- Used for file type mapping.- Returns:
- the result
-
preconditionRequired
public static Result preconditionRequired(File content, Optional<String> filename, FileMimeTypes fileMimeTypes)
Generates a 428 Precondition Required result.- Parameters:
content
- The file to send.filename
- The name to send the file as.fileMimeTypes
- Used for file type mapping.- Returns:
- the result
-
preconditionRequired
public static Result preconditionRequired(File content, boolean inline, Optional<String> filename)
Generates a 428 Precondition Required result.- Parameters:
content
- The file to send.inline
- Whether the file should be sent inline, or as an attachment.filename
- The name to send the file as.- Returns:
- the result
-
preconditionRequired
public static Result preconditionRequired(File content, boolean inline, Optional<String> filename, FileMimeTypes fileMimeTypes)
Generates a 428 Precondition Required result.- Parameters:
content
- The file to send.inline
- Whether the file should be sent inline, or as an attachment.filename
- The name to send the file as.fileMimeTypes
- Used for file type mapping.- Returns:
- the result
-
preconditionRequired
public static Result preconditionRequired(Path content)
Generates a 428 Precondition Required result.- Parameters:
content
- The path to send.- Returns:
- the result
-
preconditionRequired
public static Result preconditionRequired(Path content, FileMimeTypes fileMimeTypes)
Generates a 428 Precondition Required result.- Parameters:
content
- The path to send.fileMimeTypes
- Used for file type mapping.- Returns:
- the result
-
preconditionRequired
public static Result preconditionRequired(Path content, boolean inline)
Generates a 428 Precondition Required result.- Parameters:
content
- The path to send.inline
- Whether the file should be sent inline, or as an attachment.- Returns:
- the result
-
preconditionRequired
public static Result preconditionRequired(Path content, boolean inline, FileMimeTypes fileMimeTypes)
Generates a 428 Precondition Required result.- Parameters:
content
- The path to send.inline
- Whether the file should be sent inline, or as an attachment.fileMimeTypes
- Used for file type mapping.- Returns:
- the result
-
preconditionRequired
public static Result preconditionRequired(Path content, Optional<String> filename)
Generates a 428 Precondition Required result.- Parameters:
content
- The path to send.filename
- The name to send the file as.- Returns:
- the result
-
preconditionRequired
public static Result preconditionRequired(Path content, Optional<String> filename, FileMimeTypes fileMimeTypes)
Generates a 428 Precondition Required result.- Parameters:
content
- The path to send.filename
- The name to send the file as.fileMimeTypes
- Used for file type mapping.- Returns:
- the result
-
preconditionRequired
public static Result preconditionRequired(Path content, boolean inline, Optional<String> filename)
Generates a 428 Precondition Required result.- Parameters:
content
- The path to send.inline
- Whether the file should be sent inline, or as an attachment.filename
- The name to send the file as.- Returns:
- the result
-
preconditionRequired
public static Result preconditionRequired(Path content, boolean inline, Optional<String> filename, FileMimeTypes fileMimeTypes)
Generates a 428 Precondition Required result.- Parameters:
content
- The path to send.inline
- Whether the file should be sent inline, or as an attachment.filename
- The name to send the file as.fileMimeTypes
- Used for file type mapping.- Returns:
- the result
-
tooManyRequests
public static StatusHeader tooManyRequests()
Generates a 429 Too Many Requests result.- Returns:
- the result
-
tooManyRequests
public static Result tooManyRequests(play.twirl.api.Content content)
Generates a 429 Too Many Requests result.- Parameters:
content
- the HTTP response body- Returns:
- the result
-
tooManyRequests
public static Result tooManyRequests(play.twirl.api.Content content, String charset)
Generates a 429 Too Many Requests result.- Parameters:
content
- the HTTP response bodycharset
- the charset into which the content should be encoded (e.g. "UTF-8")- Returns:
- the result
-
tooManyRequests
public static Result tooManyRequests(String content)
Generates a 429 Too Many Requests result.- Parameters:
content
- HTTP response body, encoded as a UTF-8 string- Returns:
- the result
-
tooManyRequests
public static Result tooManyRequests(String content, String charset)
Generates a 429 Too Many Requests result.- Parameters:
content
- the HTTP response bodycharset
- the charset into which the content should be encoded (e.g. "UTF-8")- Returns:
- the result
-
tooManyRequests
public static Result tooManyRequests(com.fasterxml.jackson.databind.JsonNode content)
Generates a 429 Too Many Requests result.- Parameters:
content
- the result's body content as a play-json object. It will be encoded as a UTF-8 string.- Returns:
- the result
-
tooManyRequests
public static Result tooManyRequests(com.fasterxml.jackson.databind.JsonNode content, com.fasterxml.jackson.core.JsonEncoding encoding)
Generates a 429 Too Many Requests result.- Parameters:
content
- the result's body content as a play-json objectencoding
- the encoding into which the json should be encoded- Returns:
- the result
-
tooManyRequests
public static Result tooManyRequests(byte[] content)
Generates a 429 Too Many Requests result.- Parameters:
content
- the result's body content- Returns:
- the result
-
tooManyRequests
public static Result tooManyRequests(InputStream content)
Generates a 429 Too Many Requests result.- Parameters:
content
- the input stream containing data to chunk over- Returns:
- the result
-
tooManyRequests
public static Result tooManyRequests(InputStream content, long contentLength)
Generates a 429 Too Many Requests result.- Parameters:
content
- the input stream containing data to chunk overcontentLength
- the length of the provided content in bytes.- Returns:
- the result
-
tooManyRequests
public static Result tooManyRequests(File content)
Generates a 429 Too Many Requests result.- Parameters:
content
- The file to send.- Returns:
- the result
-
tooManyRequests
public static Result tooManyRequests(File content, FileMimeTypes fileMimeTypes)
Generates a 429 Too Many Requests result.- Parameters:
content
- The file to send.fileMimeTypes
- Used for file type mapping.- Returns:
- the result
-
tooManyRequests
public static Result tooManyRequests(File content, boolean inline)
Generates a 429 Too Many Requests result.- Parameters:
content
- The file to send.inline
- Whether the file should be sent inline, or as an attachment.- Returns:
- the result
-
tooManyRequests
public static Result tooManyRequests(File content, boolean inline, FileMimeTypes fileMimeTypes)
Generates a 429 Too Many Requests result.- Parameters:
content
- The file to send.inline
- Whether the file should be sent inline, or as an attachment.fileMimeTypes
- Used for file type mapping.- Returns:
- the result
-
tooManyRequests
@Deprecated public static Result tooManyRequests(File content, String filename)
Deprecated.Deprecated as of 2.8.0. Use totooManyRequests(File, Optional)
.Generates a 429 Too Many Requests result.- Parameters:
content
- The file to send.filename
- The name to send the file as.- Returns:
- the result
-
tooManyRequests
public static Result tooManyRequests(File content, Optional<String> filename)
Generates a 429 Too Many Requests result.- Parameters:
content
- The file to send.filename
- The name to send the file as.- Returns:
- the result
-
tooManyRequests
@Deprecated public static Result tooManyRequests(File content, String filename, FileMimeTypes fileMimeTypes)
Deprecated.Deprecated as of 2.8.0. Use totooManyRequests(File, Optional, FileMimeTypes)
.Generates a 429 Too Many Requests result.- Parameters:
content
- The file to send.filename
- The name to send the file as.fileMimeTypes
- Used for file type mapping.- Returns:
- the result
-
tooManyRequests
public static Result tooManyRequests(File content, Optional<String> filename, FileMimeTypes fileMimeTypes)
Generates a 429 Too Many Requests result.- Parameters:
content
- The file to send.filename
- The name to send the file as.fileMimeTypes
- Used for file type mapping.- Returns:
- the result
-
tooManyRequests
public static Result tooManyRequests(File content, boolean inline, Optional<String> filename)
Generates a 429 Too Many Requests result.- Parameters:
content
- The file to send.inline
- Whether the file should be sent inline, or as an attachment.filename
- The name to send the file as.- Returns:
- the result
-
tooManyRequests
public static Result tooManyRequests(File content, boolean inline, Optional<String> filename, FileMimeTypes fileMimeTypes)
Generates a 429 Too Many Requests result.- Parameters:
content
- The file to send.inline
- Whether the file should be sent inline, or as an attachment.filename
- The name to send the file as.fileMimeTypes
- Used for file type mapping.- Returns:
- the result
-
tooManyRequests
public static Result tooManyRequests(Path content)
Generates a 429 Too Many Requests result.- Parameters:
content
- The path to send.- Returns:
- the result
-
tooManyRequests
public static Result tooManyRequests(Path content, FileMimeTypes fileMimeTypes)
Generates a 429 Too Many Requests result.- Parameters:
content
- The path to send.fileMimeTypes
- Used for file type mapping.- Returns:
- the result
-
tooManyRequests
public static Result tooManyRequests(Path content, boolean inline)
Generates a 429 Too Many Requests result.- Parameters:
content
- The path to send.inline
- Whether the file should be sent inline, or as an attachment.- Returns:
- the result
-
tooManyRequests
public static Result tooManyRequests(Path content, boolean inline, FileMimeTypes fileMimeTypes)
Generates a 429 Too Many Requests result.- Parameters:
content
- The path to send.inline
- Whether the file should be sent inline, or as an attachment.fileMimeTypes
- Used for file type mapping.- Returns:
- the result
-
tooManyRequests
public static Result tooManyRequests(Path content, Optional<String> filename)
Generates a 429 Too Many Requests result.- Parameters:
content
- The path to send.filename
- The name to send the file as.- Returns:
- the result
-
tooManyRequests
public static Result tooManyRequests(Path content, Optional<String> filename, FileMimeTypes fileMimeTypes)
Generates a 429 Too Many Requests result.- Parameters:
content
- The path to send.filename
- The name to send the file as.fileMimeTypes
- Used for file type mapping.- Returns:
- the result
-
tooManyRequests
public static Result tooManyRequests(Path content, boolean inline, Optional<String> filename)
Generates a 429 Too Many Requests result.- Parameters:
content
- The path to send.inline
- Whether the file should be sent inline, or as an attachment.filename
- The name to send the file as.- Returns:
- the result
-
tooManyRequests
public static Result tooManyRequests(Path content, boolean inline, Optional<String> filename, FileMimeTypes fileMimeTypes)
Generates a 429 Too Many Requests result.- Parameters:
content
- The path to send.inline
- Whether the file should be sent inline, or as an attachment.filename
- The name to send the file as.fileMimeTypes
- Used for file type mapping.- Returns:
- the result
-
requestHeaderFieldsTooLarge
public static StatusHeader requestHeaderFieldsTooLarge()
Generates a 431 Request Header Fields Too Large result.- Returns:
- the result
-
requestHeaderFieldsTooLarge
public static Result requestHeaderFieldsTooLarge(play.twirl.api.Content content)
Generates a 431 Request Header Fields Too Large result.- Parameters:
content
- the HTTP response body- Returns:
- the result
-
requestHeaderFieldsTooLarge
public static Result requestHeaderFieldsTooLarge(play.twirl.api.Content content, String charset)
Generates a 431 Request Header Fields Too Large result.- Parameters:
content
- the HTTP response bodycharset
- the charset into which the content should be encoded (e.g. "UTF-8")- Returns:
- the result
-
requestHeaderFieldsTooLarge
public static Result requestHeaderFieldsTooLarge(String content)
Generates a 431 Request Header Fields Too Large result.- Parameters:
content
- HTTP response body, encoded as a UTF-8 string- Returns:
- the result
-
requestHeaderFieldsTooLarge
public static Result requestHeaderFieldsTooLarge(String content, String charset)
Generates a 431 Request Header Fields Too Large result.- Parameters:
content
- the HTTP response bodycharset
- the charset into which the content should be encoded (e.g. "UTF-8")- Returns:
- the result
-
requestHeaderFieldsTooLarge
public static Result requestHeaderFieldsTooLarge(com.fasterxml.jackson.databind.JsonNode content)
Generates a 431 Request Header Fields Too Large result.- Parameters:
content
- the result's body content as a play-json object. It will be encoded as a UTF-8 string.- Returns:
- the result
-
requestHeaderFieldsTooLarge
public static Result requestHeaderFieldsTooLarge(com.fasterxml.jackson.databind.JsonNode content, com.fasterxml.jackson.core.JsonEncoding encoding)
Generates a 431 Request Header Fields Too Large result.- Parameters:
content
- the result's body content as a play-json objectencoding
- the encoding into which the json should be encoded- Returns:
- the result
-
requestHeaderFieldsTooLarge
public static Result requestHeaderFieldsTooLarge(byte[] content)
Generates a 431 Request Header Fields Too Large result.- Parameters:
content
- the result's body content- Returns:
- the result
-
requestHeaderFieldsTooLarge
public static Result requestHeaderFieldsTooLarge(InputStream content)
Generates a 431 Request Header Fields Too Large result.- Parameters:
content
- the input stream containing data to chunk over- Returns:
- the result
-
requestHeaderFieldsTooLarge
public static Result requestHeaderFieldsTooLarge(InputStream content, long contentLength)
Generates a 431 Request Header Fields Too Large result.- Parameters:
content
- the input stream containing data to chunk overcontentLength
- the length of the provided content in bytes.- Returns:
- the result
-
requestHeaderFieldsTooLarge
public static Result requestHeaderFieldsTooLarge(File content)
Generates a 431 Request Header Fields Too Large result.- Parameters:
content
- The file to send.- Returns:
- the result
-
requestHeaderFieldsTooLarge
public static Result requestHeaderFieldsTooLarge(File content, FileMimeTypes fileMimeTypes)
Generates a 431 Request Header Fields Too Large result.- Parameters:
content
- The file to send.fileMimeTypes
- Used for file type mapping.- Returns:
- the result
-
requestHeaderFieldsTooLarge
public static Result requestHeaderFieldsTooLarge(File content, boolean inline)
Generates a 431 Request Header Fields Too Large result.- Parameters:
content
- The file to send.inline
- Whether the file should be sent inline, or as an attachment.- Returns:
- the result
-
requestHeaderFieldsTooLarge
public static Result requestHeaderFieldsTooLarge(File content, boolean inline, FileMimeTypes fileMimeTypes)
Generates a 431 Request Header Fields Too Large result.- Parameters:
content
- The file to send.inline
- Whether the file should be sent inline, or as an attachment.fileMimeTypes
- Used for file type mapping.- Returns:
- the result
-
requestHeaderFieldsTooLarge
@Deprecated public static Result requestHeaderFieldsTooLarge(File content, String filename)
Deprecated.Deprecated as of 2.8.0. Use torequestHeaderFieldsTooLarge(File, Optional)
.Generates a 431 Request Header Fields Too Large result.- Parameters:
content
- The file to send.filename
- The name to send the file as.- Returns:
- the result
-
requestHeaderFieldsTooLarge
public static Result requestHeaderFieldsTooLarge(File content, Optional<String> filename)
Generates a 431 Request Header Fields Too Large result.- Parameters:
content
- The file to send.filename
- The name to send the file as.- Returns:
- the result
-
requestHeaderFieldsTooLarge
@Deprecated public static Result requestHeaderFieldsTooLarge(File content, String filename, FileMimeTypes fileMimeTypes)
Deprecated.Deprecated as of 2.8.0. Use torequestHeaderFieldsTooLarge(File, Optional, FileMimeTypes)
.Generates a 431 Request Header Fields Too Large result.- Parameters:
content
- The file to send.filename
- The name to send the file as.fileMimeTypes
- Used for file type mapping.- Returns:
- the result
-
requestHeaderFieldsTooLarge
public static Result requestHeaderFieldsTooLarge(File content, Optional<String> filename, FileMimeTypes fileMimeTypes)
Generates a 431 Request Header Fields Too Large result.- Parameters:
content
- The file to send.filename
- The name to send the file as.fileMimeTypes
- Used for file type mapping.- Returns:
- the result
-
requestHeaderFieldsTooLarge
public static Result requestHeaderFieldsTooLarge(File content, boolean inline, Optional<String> filename)
Generates a 431 Request Header Fields Too Large result.- Parameters:
content
- The file to send.inline
- Whether the file should be sent inline, or as an attachment.filename
- The name to send the file as.- Returns:
- the result
-
requestHeaderFieldsTooLarge
public static Result requestHeaderFieldsTooLarge(File content, boolean inline, Optional<String> filename, FileMimeTypes fileMimeTypes)
Generates a 431 Request Header Fields Too Large result.- Parameters:
content
- The file to send.inline
- Whether the file should be sent inline, or as an attachment.filename
- The name to send the file as.fileMimeTypes
- Used for file type mapping.- Returns:
- the result
-
requestHeaderFieldsTooLarge
public static Result requestHeaderFieldsTooLarge(Path content)
Generates a 431 Request Header Fields Too Large result.- Parameters:
content
- The path to send.- Returns:
- the result
-
requestHeaderFieldsTooLarge
public static Result requestHeaderFieldsTooLarge(Path content, FileMimeTypes fileMimeTypes)
Generates a 431 Request Header Fields Too Large result.- Parameters:
content
- The path to send.fileMimeTypes
- Used for file type mapping.- Returns:
- the result
-
requestHeaderFieldsTooLarge
public static Result requestHeaderFieldsTooLarge(Path content, boolean inline)
Generates a 431 Request Header Fields Too Large result.- Parameters:
content
- The path to send.inline
- Whether the file should be sent inline, or as an attachment.- Returns:
- the result
-
requestHeaderFieldsTooLarge
public static Result requestHeaderFieldsTooLarge(Path content, boolean inline, FileMimeTypes fileMimeTypes)
Generates a 431 Request Header Fields Too Large result.- Parameters:
content
- The path to send.inline
- Whether the file should be sent inline, or as an attachment.fileMimeTypes
- Used for file type mapping.- Returns:
- the result
-
requestHeaderFieldsTooLarge
public static Result requestHeaderFieldsTooLarge(Path content, Optional<String> filename)
Generates a 431 Request Header Fields Too Large result.- Parameters:
content
- The path to send.filename
- The name to send the file as.- Returns:
- the result
-
requestHeaderFieldsTooLarge
public static Result requestHeaderFieldsTooLarge(Path content, Optional<String> filename, FileMimeTypes fileMimeTypes)
Generates a 431 Request Header Fields Too Large result.- Parameters:
content
- The path to send.filename
- The name to send the file as.fileMimeTypes
- Used for file type mapping.- Returns:
- the result
-
requestHeaderFieldsTooLarge
public static Result requestHeaderFieldsTooLarge(Path content, boolean inline, Optional<String> filename)
Generates a 431 Request Header Fields Too Large result.- Parameters:
content
- The path to send.inline
- Whether the file should be sent inline, or as an attachment.filename
- The name to send the file as.- Returns:
- the result
-
requestHeaderFieldsTooLarge
public static Result requestHeaderFieldsTooLarge(Path content, boolean inline, Optional<String> filename, FileMimeTypes fileMimeTypes)
Generates a 431 Request Header Fields Too Large result.- Parameters:
content
- The path to send.inline
- Whether the file should be sent inline, or as an attachment.filename
- The name to send the file as.fileMimeTypes
- Used for file type mapping.- Returns:
- the result
-
internalServerError
public static StatusHeader internalServerError()
Generates a 500 Internal Server Error result.- Returns:
- the result
-
internalServerError
public static Result internalServerError(play.twirl.api.Content content)
Generates a 500 Internal Server Error result.- Parameters:
content
- the HTTP response body- Returns:
- the result
-
internalServerError
public static Result internalServerError(play.twirl.api.Content content, String charset)
Generates a 500 Internal Server Error result.- Parameters:
content
- the HTTP response bodycharset
- the charset into which the content should be encoded (e.g. "UTF-8")- Returns:
- the result
-
internalServerError
public static Result internalServerError(String content)
Generates a 500 Internal Server Error result.- Parameters:
content
- HTTP response body, encoded as a UTF-8 string- Returns:
- the result
-
internalServerError
public static Result internalServerError(String content, String charset)
Generates a 500 Internal Server Error result.- Parameters:
content
- the HTTP response bodycharset
- the charset into which the content should be encoded (e.g. "UTF-8")- Returns:
- the result
-
internalServerError
public static Result internalServerError(com.fasterxml.jackson.databind.JsonNode content)
Generates a 500 Internal Server Error result.- Parameters:
content
- the result's body content as a play-json object. It will be encoded as a UTF-8 string.- Returns:
- the result
-
internalServerError
public static Result internalServerError(com.fasterxml.jackson.databind.JsonNode content, com.fasterxml.jackson.core.JsonEncoding encoding)
Generates a 500 Internal Server Error result.- Parameters:
content
- the result's body content as a play-json objectencoding
- the encoding into which the json should be encoded- Returns:
- the result
-
internalServerError
public static Result internalServerError(byte[] content)
Generates a 500 Internal Server Error result.- Parameters:
content
- the result's body content- Returns:
- the result
-
internalServerError
public static Result internalServerError(InputStream content)
Generates a 500 Internal Server Error result.- Parameters:
content
- the input stream containing data to chunk over- Returns:
- the result
-
internalServerError
public static Result internalServerError(InputStream content, long contentLength)
Generates a 500 Internal Server Error result.- Parameters:
content
- the input stream containing data to chunk overcontentLength
- the length of the provided content in bytes.- Returns:
- the result
-
internalServerError
public static Result internalServerError(File content)
Generates a 500 Internal Server Error result.- Parameters:
content
- The file to send.- Returns:
- the result
-
internalServerError
public static Result internalServerError(File content, FileMimeTypes fileMimeTypes)
Generates a 500 Internal Server Error result.- Parameters:
content
- The file to send.fileMimeTypes
- Used for file type mapping.- Returns:
- the result
-
internalServerError
public static Result internalServerError(File content, boolean inline)
Generates a 500 Internal Server Error result.- Parameters:
content
- The file to send.inline
- Whether the file should be sent inline, or as an attachment.- Returns:
- the result
-
internalServerError
public static Result internalServerError(File content, boolean inline, FileMimeTypes fileMimeTypes)
Generates a 500 Internal Server Error result.- Parameters:
content
- The file to send.inline
- Whether the file should be sent inline, or as an attachment.fileMimeTypes
- Used for file type mapping.- Returns:
- the result
-
internalServerError
@Deprecated public static Result internalServerError(File content, String filename)
Deprecated.Deprecated as of 2.8.0. Use tointernalServerError(File, Optional)
.Generates a 500 Internal Server Error result.- Parameters:
content
- The file to send.filename
- The name to send the file as.- Returns:
- the result
-
internalServerError
public static Result internalServerError(File content, Optional<String> filename)
Generates a 500 Internal Server Error result.- Parameters:
content
- The file to send.filename
- The name to send the file as.- Returns:
- the result
-
internalServerError
@Deprecated public static Result internalServerError(File content, String filename, FileMimeTypes fileMimeTypes)
Deprecated.Deprecated as of 2.8.0. Use tointernalServerError(File, Optional, FileMimeTypes)
.Generates a 500 Internal Server Error result.- Parameters:
content
- The file to send.filename
- The name to send the file as.fileMimeTypes
- Used for file type mapping.- Returns:
- the result
-
internalServerError
public static Result internalServerError(File content, Optional<String> filename, FileMimeTypes fileMimeTypes)
Generates a 500 Internal Server Error result.- Parameters:
content
- The file to send.filename
- The name to send the file as.fileMimeTypes
- Used for file type mapping.- Returns:
- the result
-
internalServerError
public static Result internalServerError(File content, boolean inline, Optional<String> filename)
Generates a 500 Internal Server Error result.- Parameters:
content
- The file to send.inline
- Whether the file should be sent inline, or as an attachment.filename
- The name to send the file as.- Returns:
- the result
-
internalServerError
public static Result internalServerError(File content, boolean inline, Optional<String> filename, FileMimeTypes fileMimeTypes)
Generates a 500 Internal Server Error result.- Parameters:
content
- The file to send.inline
- Whether the file should be sent inline, or as an attachment.filename
- The name to send the file as.fileMimeTypes
- Used for file type mapping.- Returns:
- the result
-
internalServerError
public static Result internalServerError(Path content)
Generates a 500 Internal Server Error result.- Parameters:
content
- The path to send.- Returns:
- the result
-
internalServerError
public static Result internalServerError(Path content, FileMimeTypes fileMimeTypes)
Generates a 500 Internal Server Error result.- Parameters:
content
- The path to send.fileMimeTypes
- Used for file type mapping.- Returns:
- the result
-
internalServerError
public static Result internalServerError(Path content, boolean inline)
Generates a 500 Internal Server Error result.- Parameters:
content
- The path to send.inline
- Whether the file should be sent inline, or as an attachment.- Returns:
- the result
-
internalServerError
public static Result internalServerError(Path content, boolean inline, FileMimeTypes fileMimeTypes)
Generates a 500 Internal Server Error result.- Parameters:
content
- The path to send.inline
- Whether the file should be sent inline, or as an attachment.fileMimeTypes
- Used for file type mapping.- Returns:
- the result
-
internalServerError
public static Result internalServerError(Path content, Optional<String> filename)
Generates a 500 Internal Server Error result.- Parameters:
content
- The path to send.filename
- The name to send the file as.- Returns:
- the result
-
internalServerError
public static Result internalServerError(Path content, Optional<String> filename, FileMimeTypes fileMimeTypes)
Generates a 500 Internal Server Error result.- Parameters:
content
- The path to send.filename
- The name to send the file as.fileMimeTypes
- Used for file type mapping.- Returns:
- the result
-
internalServerError
public static Result internalServerError(Path content, boolean inline, Optional<String> filename)
Generates a 500 Internal Server Error result.- Parameters:
content
- The path to send.inline
- Whether the file should be sent inline, or as an attachment.filename
- The name to send the file as.- Returns:
- the result
-
internalServerError
public static Result internalServerError(Path content, boolean inline, Optional<String> filename, FileMimeTypes fileMimeTypes)
Generates a 500 Internal Server Error result.- Parameters:
content
- The path to send.inline
- Whether the file should be sent inline, or as an attachment.filename
- The name to send the file as.fileMimeTypes
- Used for file type mapping.- Returns:
- the result
-
networkAuthenticationRequired
public static StatusHeader networkAuthenticationRequired()
Generates a 511 Network Authentication Required result.- Returns:
- the result
-
networkAuthenticationRequired
public static Result networkAuthenticationRequired(play.twirl.api.Content content)
Generates a 511 Network Authentication Required result.- Parameters:
content
- the HTTP response body- Returns:
- the result
-
networkAuthenticationRequired
public static Result networkAuthenticationRequired(play.twirl.api.Content content, String charset)
Generates a 511 Network Authentication Required result.- Parameters:
content
- the HTTP response bodycharset
- the charset into which the content should be encoded (e.g. "UTF-8")- Returns:
- the result
-
networkAuthenticationRequired
public static Result networkAuthenticationRequired(String content)
Generates a 511 Network Authentication Required result.- Parameters:
content
- HTTP response body, encoded as a UTF-8 string- Returns:
- the result
-
networkAuthenticationRequired
public static Result networkAuthenticationRequired(String content, String charset)
Generates a 511 Network Authentication Required result.- Parameters:
content
- the HTTP response bodycharset
- the charset into which the content should be encoded (e.g. "UTF-8")- Returns:
- the result
-
networkAuthenticationRequired
public static Result networkAuthenticationRequired(com.fasterxml.jackson.databind.JsonNode content)
Generates a 511 Network Authentication Required result.- Parameters:
content
- the result's body content as a play-json object. It will be encoded as a UTF-8 string.- Returns:
- the result
-
networkAuthenticationRequired
public static Result networkAuthenticationRequired(com.fasterxml.jackson.databind.JsonNode content, com.fasterxml.jackson.core.JsonEncoding encoding)
Generates a 511 Network Authentication Required result.- Parameters:
content
- the result's body content as a play-json objectencoding
- the encoding into which the json should be encoded- Returns:
- the result
-
networkAuthenticationRequired
public static Result networkAuthenticationRequired(byte[] content)
Generates a 511 Network Authentication Required result.- Parameters:
content
- the result's body content- Returns:
- the result
-
networkAuthenticationRequired
public static Result networkAuthenticationRequired(InputStream content)
Generates a 511 Network Authentication Required result.- Parameters:
content
- the input stream containing data to chunk over- Returns:
- the result
-
networkAuthenticationRequired
public static Result networkAuthenticationRequired(InputStream content, long contentLength)
Generates a 511 Network Authentication Required result.- Parameters:
content
- the input stream containing data to chunk overcontentLength
- the length of the provided content in bytes.- Returns:
- the result
-
networkAuthenticationRequired
public static Result networkAuthenticationRequired(File content)
Generates a 511 Network Authentication Required result.- Parameters:
content
- The file to send.- Returns:
- the result
-
networkAuthenticationRequired
public static Result networkAuthenticationRequired(File content, FileMimeTypes fileMimeTypes)
Generates a 511 Network Authentication Required result.- Parameters:
content
- The file to send.fileMimeTypes
- Used for file type mapping.- Returns:
- the result
-
networkAuthenticationRequired
public static Result networkAuthenticationRequired(File content, boolean inline)
Generates a 511 Network Authentication Required result.- Parameters:
content
- The file to send.inline
- Whether the file should be sent inline, or as an attachment.- Returns:
- the result
-
networkAuthenticationRequired
public static Result networkAuthenticationRequired(File content, boolean inline, FileMimeTypes fileMimeTypes)
Generates a 511 Network Authentication Required result.- Parameters:
content
- The file to send.inline
- Whether the file should be sent inline, or as an attachment.fileMimeTypes
- Used for file type mapping.- Returns:
- the result
-
networkAuthenticationRequired
@Deprecated public static Result networkAuthenticationRequired(File content, String filename)
Deprecated.Deprecated as of 2.8.0. Use tonetworkAuthenticationRequired(File, Optional)
.Generates a 511 Network Authentication Required result.- Parameters:
content
- The file to send.filename
- The name to send the file as.- Returns:
- the result
-
networkAuthenticationRequired
public static Result networkAuthenticationRequired(File content, Optional<String> filename)
Generates a 511 Network Authentication Required result.- Parameters:
content
- The file to send.filename
- The name to send the file as.- Returns:
- the result
-
networkAuthenticationRequired
@Deprecated public static Result networkAuthenticationRequired(File content, String filename, FileMimeTypes fileMimeTypes)
Deprecated.Deprecated as of 2.8.0. Use tonetworkAuthenticationRequired(File, Optional, FileMimeTypes)
.Generates a 511 Network Authentication Required result.- Parameters:
content
- The file to send.filename
- The name to send the file as.fileMimeTypes
- Used for file type mapping.- Returns:
- the result
-
networkAuthenticationRequired
public static Result networkAuthenticationRequired(File content, Optional<String> filename, FileMimeTypes fileMimeTypes)
Generates a 511 Network Authentication Required result.- Parameters:
content
- The file to send.filename
- The name to send the file as.fileMimeTypes
- Used for file type mapping.- Returns:
- the result
-
networkAuthenticationRequired
public static Result networkAuthenticationRequired(File content, boolean inline, Optional<String> filename)
Generates a 511 Network Authentication Required result.- Parameters:
content
- The file to send.inline
- Whether the file should be sent inline, or as an attachment.filename
- The name to send the file as.- Returns:
- the result
-
networkAuthenticationRequired
public static Result networkAuthenticationRequired(File content, boolean inline, Optional<String> filename, FileMimeTypes fileMimeTypes)
Generates a 511 Network Authentication Required result.- Parameters:
content
- The file to send.inline
- Whether the file should be sent inline, or as an attachment.filename
- The name to send the file as.fileMimeTypes
- Used for file type mapping.- Returns:
- the result
-
networkAuthenticationRequired
public static Result networkAuthenticationRequired(Path content)
Generates a 511 Network Authentication Required result.- Parameters:
content
- The path to send.- Returns:
- the result
-
networkAuthenticationRequired
public static Result networkAuthenticationRequired(Path content, FileMimeTypes fileMimeTypes)
Generates a 511 Network Authentication Required result.- Parameters:
content
- The path to send.fileMimeTypes
- Used for file type mapping.- Returns:
- the result
-
networkAuthenticationRequired
public static Result networkAuthenticationRequired(Path content, boolean inline)
Generates a 511 Network Authentication Required result.- Parameters:
content
- The path to send.inline
- Whether the file should be sent inline, or as an attachment.- Returns:
- the result
-
networkAuthenticationRequired
public static Result networkAuthenticationRequired(Path content, boolean inline, FileMimeTypes fileMimeTypes)
Generates a 511 Network Authentication Required result.- Parameters:
content
- The path to send.inline
- Whether the file should be sent inline, or as an attachment.fileMimeTypes
- Used for file type mapping.- Returns:
- the result
-
networkAuthenticationRequired
public static Result networkAuthenticationRequired(Path content, Optional<String> filename)
Generates a 511 Network Authentication Required result.- Parameters:
content
- The path to send.filename
- The name to send the file as.- Returns:
- the result
-
networkAuthenticationRequired
public static Result networkAuthenticationRequired(Path content, Optional<String> filename, FileMimeTypes fileMimeTypes)
Generates a 511 Network Authentication Required result.- Parameters:
content
- The path to send.filename
- The name to send the file as.fileMimeTypes
- Used for file type mapping.- Returns:
- the result
-
networkAuthenticationRequired
public static Result networkAuthenticationRequired(Path content, boolean inline, Optional<String> filename)
Generates a 511 Network Authentication Required result.- Parameters:
content
- The path to send.inline
- Whether the file should be sent inline, or as an attachment.filename
- The name to send the file as.- Returns:
- the result
-
networkAuthenticationRequired
public static Result networkAuthenticationRequired(Path content, boolean inline, Optional<String> filename, FileMimeTypes fileMimeTypes)
Generates a 511 Network Authentication Required result.- Parameters:
content
- The path to send.inline
- Whether the file should be sent inline, or as an attachment.filename
- The name to send the file as.fileMimeTypes
- Used for file type mapping.- Returns:
- the result
-
movedPermanently
public static Result movedPermanently(String url)
Generates a 301 Moved Permanently result.- Parameters:
url
- The url to redirect.- Returns:
- the result
-
movedPermanently
public static Result movedPermanently(Call call)
Generates a 301 Moved Permanently result.- Parameters:
call
- Call defining the url to redirect (typically comes from reverse router).- Returns:
- the result
-
found
public static Result found(String url)
Generates a 302 Found result.- Parameters:
url
- The url to redirect.- Returns:
- the result
-
found
public static Result found(Call call)
Generates a 302 Found result.- Parameters:
call
- Call defining the url to redirect (typically comes from reverse router).- Returns:
- the result
-
seeOther
public static Result seeOther(String url)
Generates a 303 See Other result.- Parameters:
url
- The url to redirect.- Returns:
- the result
-
seeOther
public static Result seeOther(Call call)
Generates a 303 See Other result.- Parameters:
call
- Call defining the url to redirect (typically comes from reverse router).- Returns:
- the result
-
redirect
public static Result redirect(String url)
Generates a 303 See Other result.- Parameters:
url
- The url to redirect.- Returns:
- the result
-
redirect
public static Result redirect(String url, Map<String,List<String>> queryStringParams)
Generates a 303 See Other result.- Parameters:
url
- The url to redirectqueryStringParams
- queryString parameters to add to the queryString- Returns:
- the result
-
redirect
public static Result redirect(Call call)
Generates a 303 See Other result.- Parameters:
call
- Call defining the url to redirect (typically comes from reverse router).- Returns:
- the result
-
temporaryRedirect
public static Result temporaryRedirect(String url)
Generates a 307 Temporary Redirect result.- Parameters:
url
- The url to redirect.- Returns:
- the result
-
temporaryRedirect
public static Result temporaryRedirect(Call call)
Generates a 307 Temporary Redirect result.- Parameters:
call
- Call defining the url to redirect (typically comes from reverse router).- Returns:
- the result
-
permanentRedirect
public static Result permanentRedirect(String url)
Generates a 308 Permanent Redirect result.- Parameters:
url
- The url to redirect.- Returns:
- the result
-
-