Interface FormDataParser
- All Superinterfaces:
AutoCloseable,Closeable
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
-
Method Summary
Modifier and TypeMethodDescriptionvoidclose()Closes the parser, and removes and temporary files that may have been created.voidparse()Parse the form data asynchronously.Parse the data, blocking the current thread until parsing is complete.voidsetCharacterEncoding(String encoding) Sets the character encoding that will be used by this parser.
-
Method Details
-
parse
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.The method can either invoke the next handler directly, or may delegate to the IO thread to perform the parsing.
- Throws:
Exception
-
parseBlocking
Parse the data, blocking the current thread until parsing is complete.- Returns:
- The parsed form data
- Throws:
IOException- If the data could not be readException
-
close
Closes the parser, and removes and temporary files that may have been created.- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Throws:
IOException
-
setCharacterEncoding
Sets the character encoding that will be used by this parser. If the request is already processed this will have no effect- Parameters:
encoding- The encoding
-