Package ej.hoka.http.body
Class ParameterParser
- java.lang.Object
-
- ej.hoka.http.body.ParameterParser
-
- All Implemented Interfaces:
BodyParser<Map<String,String>>
public class ParameterParser extends Object implements BodyParser<Map<String,String>>
A parser forMime.MIME_FORM_ENCODED_DATAand parameters in URI.
-
-
Constructor Summary
Constructors Constructor Description ParameterParser()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description Map<String,String>parseBody(InputStream inputStream, String contentType)Parse the body.static voidparseParameters(InputStream input, Map<String,String> parameters)Parses parameters.
-
-
-
Method Detail
-
parseBody
public Map<String,String> parseBody(InputStream inputStream, @Nullable String contentType) throws IOException
Description copied from interface:BodyParserParse the body.- Specified by:
parseBodyin interfaceBodyParser<Map<String,String>>- Parameters:
inputStream- the bodyInputStream.contentType- the"content-type"header of the request.- Returns:
- the body.
- Throws:
IOException- when anIOExceptionoccurs during the parsing.
-
parseParameters
public static void parseParameters(InputStream input, Map<String,String> parameters) throws IOException
Parses parameters.- Parameters:
input- the input stream from which parameters should be parsedparameters- the map to populate with the parsed parameters.- Throws:
IOException- if an error occurs while reading the input stream.
-
-