Search in sources :

Example 6 with FormData

use of io.undertow.server.handlers.form.FormData in project undertow by undertow-io.

the class MCMPHandler method parseFormData.

/**
     * Transform the form data into an intermediate request data which can me used
     * by the web manager
     *
     * @param exchange    the http server exchange
     * @return
     * @throws IOException
     */
RequestData parseFormData(final HttpServerExchange exchange) throws IOException {
    // Read post parameters
    final FormDataParser parser = parserFactory.createParser(exchange);
    final FormData formData = parser.parseBlocking();
    final RequestData data = new RequestData();
    for (String name : formData) {
        final HttpString key = new HttpString(name);
        data.add(key, formData.get(name));
    }
    return data;
}
Also used : FormData(io.undertow.server.handlers.form.FormData) FormDataParser(io.undertow.server.handlers.form.FormDataParser) HttpString(io.undertow.util.HttpString) HttpString(io.undertow.util.HttpString)

Aggregations

FormData (io.undertow.server.handlers.form.FormData)6 HttpString (io.undertow.util.HttpString)5 ArrayList (java.util.ArrayList)3 FormDataParser (io.undertow.server.handlers.form.FormDataParser)2 HashMap (java.util.HashMap)2 Account (io.undertow.security.idm.Account)1 IdentityManager (io.undertow.security.idm.IdentityManager)1 PasswordCredential (io.undertow.security.idm.PasswordCredential)1 ServletRequestContext (io.undertow.servlet.handlers.ServletRequestContext)1 HeaderMap (io.undertow.util.HeaderMap)1 IOException (java.io.IOException)1 Deque (java.util.Deque)1 Map (java.util.Map)1 Part (javax.servlet.http.Part)1 Message (org.apache.camel.Message)1 DefaultAttachment (org.apache.camel.impl.DefaultAttachment)1 DefaultMessage (org.apache.camel.impl.DefaultMessage)1