Top Description Fields Methods
io.undertow.server.handlers.form

public Interface FormDataParser

extends Closeable
Known Direct Implementers
io.undertow.server.handlers.form.FormEncodedDataDefinition.FormEncodedDataParser, io.undertow.server.handlers.form.MultiPartParserDefinition.MultiPartUploadHandler
Imports
java.io.Closeable, .IOException, io.undertow.server.HttpHandler, io.undertow.util.AttachmentKey

Parser for form data. This can be used by down-stream handlers to parse form data.

This parser must be closed to make sure any temporary files have been cleaned up.

Author
Stuart Douglas

Field Summary

Modifier and TypeField and Description
public static final AttachmentKey<FormData>
FORM_DATA

When the form data is parsed it will be attached under this key.

Method Summary

Modifier and TypeMethod and Description
public void
close()

Redeclares java.io.Closeable.close.

Closes the parser, and removes and temporary files that may have been created.

public void
parse(final HttpHandler next)

Parse the form data asynchronously.

public FormData

Returns:

The parsed form data
parseBlocking
()

Parse the data, blocking the current thread until parsing is complete.

public void
setCharacterEncoding(String
The encoding
encoding
)

Sets the character encoding that will be used by this parser.

Field Detail

FORM_DATAback to summary
public static final AttachmentKey<FormData> FORM_DATA

When the form data is parsed it will be attached under this key.

Method Detail

closeback to summary
public void close() throws IOException

Redeclares java.io.Closeable.close.

Closes the parser, and removes and temporary files that may have been created.

Exceptions
IOException:

Doc from java.io.Closeable.close.

if an I/O error occurs

parseback to summary
public void parse(final HttpHandler next) throws Exception

Parse the form data asynchronously. If all the data cannot be read immediately then a read listener will be registered, and the data will be parsed by the read thread.

When this method completes the handler will be invoked, and the data will be attached under FORM_DATA.

The method can either invoke the next handler directly, or may delegate to the IO thread to perform the parsing.

parseBlockingback to summary
public FormData parseBlocking() throws IOException

Parse the data, blocking the current thread until parsing is complete. For blocking handlers this method is more efficient than parse(io.undertow.server.HttpHandler next), as the calling thread should do that actual parsing, rather than the read thread

Returns:FormData

The parsed form data

Exceptions
IOException:
If the data could not be read
setCharacterEncodingback to summary
public void setCharacterEncoding(String encoding)

Sets the character encoding that will be used by this parser. If the request is already processed this will have no effect

Parameters
encoding:String

The encoding