Package play.mvc
Class BodyParser.BufferingBodyParser<A>
- Object
-
- play.mvc.BodyParser.MaxLengthBodyParser<A>
-
- play.mvc.BodyParser.BufferingBodyParser<A>
-
- All Implemented Interfaces:
BodyParser<A>
- Direct Known Subclasses:
BodyParser.Bytes
,BodyParser.FormUrlEncoded
,BodyParser.Text
,BodyParser.TolerantJson
,BodyParser.TolerantText
,BodyParser.TolerantXml
- Enclosing interface:
- BodyParser<A>
public abstract static class BodyParser.BufferingBodyParser<A> extends BodyParser.MaxLengthBodyParser<A>
A body parser that first buffers
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface play.mvc.BodyParser
BodyParser.AnyContent, BodyParser.BufferingBodyParser<A>, BodyParser.Bytes, BodyParser.CompletableBodyParser<A>, BodyParser.Default, BodyParser.DelegatingBodyParser<A,B>, BodyParser.DelegatingMultipartFormDataBodyParser<A>, BodyParser.Empty, BodyParser.FormUrlEncoded, BodyParser.Json, BodyParser.MaxLengthBodyParser<A>, BodyParser.MultipartFormData, BodyParser.Of, BodyParser.Raw, BodyParser.TemporaryFile, BodyParser.Text, BodyParser.ToFile, BodyParser.TolerantJson, BodyParser.TolerantText, BodyParser.TolerantXml, BodyParser.Xml
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
BufferingBodyParser(long maxLength, HttpErrorHandler errorHandler, String errorMessage)
protected
BufferingBodyParser(play.api.http.HttpConfiguration httpConfiguration, HttpErrorHandler errorHandler, String errorMessage)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected Accumulator<ByteString,F.Either<Result,A>>
apply1(Http.RequestHeader request)
Implement this method to implement the actual body parser.protected abstract A
parse(Http.RequestHeader request, ByteString bytes)
Parse the body.-
Methods inherited from class play.mvc.BodyParser.MaxLengthBodyParser
apply
-
-
-
-
Constructor Detail
-
BufferingBodyParser
protected BufferingBodyParser(long maxLength, HttpErrorHandler errorHandler, String errorMessage)
-
BufferingBodyParser
protected BufferingBodyParser(play.api.http.HttpConfiguration httpConfiguration, HttpErrorHandler errorHandler, String errorMessage)
-
-
Method Detail
-
apply1
protected final Accumulator<ByteString,F.Either<Result,A>> apply1(Http.RequestHeader request)
Description copied from class:BodyParser.MaxLengthBodyParser
Implement this method to implement the actual body parser.- Specified by:
apply1
in classBodyParser.MaxLengthBodyParser<A>
- Parameters:
request
- header for the request to parse- Returns:
- the accumulator that parses the request
-
parse
protected abstract A parse(Http.RequestHeader request, ByteString bytes) throws Exception
Parse the body.- Parameters:
request
- The request associated with the body.bytes
- The bytes of the body.- Returns:
- The body.
- Throws:
Exception
- If the body failed to parse. It is assumed that any exceptions thrown by this method are the fault of the client, so a 400 bad request error will be returned if this method throws an exception.
-
-