Package io.undertow.server.handlers.form

Examples of io.undertow.server.handlers.form.FormData


            String mimeType = exchange.getRequestHeaders().getFirst(Headers.CONTENT_TYPE);
            if (mimeType != null && mimeType.startsWith(MultiPartParserDefinition.MULTIPART_FORM_DATA)) {
                final ManagedServlet originalServlet = exchange.getAttachment(ServletRequestContext.ATTACHMENT_KEY).getOriginalServletPathMatch().getServletChain().getManagedServlet();
                final FormDataParser parser = originalServlet.getFormParserFactory().createParser(exchange);
                if(parser != null) {
                    final FormData value = parser.parseBlocking();
                    for (final String namedPart : value) {
                        for (FormData.FormValue part : value.get(namedPart)) {
                            parts.add(new PartImpl(namedPart, part));
                        }
                    }
                }
            } else {
View Full Code Here


            queryParameters = exchange.getQueryParameters();
        }
        Deque<String> params = queryParameters.get(name);
        if (params == null) {
            if (exchange.getRequestMethod().equals(Methods.POST)) {
                final FormData parsedFormData = parseFormData();
                if (parsedFormData != null) {
                    FormData.FormValue res = parsedFormData.getFirst(name);
                    if (res == null || res.isFile()) {
                        return null;
                    } else {
                        return res.getValue();
                    }
View Full Code Here

        if (queryParameters == null) {
            queryParameters = exchange.getQueryParameters();
        }
        final Set<String> parameterNames = new HashSet<String>(queryParameters.keySet());
        if (exchange.getRequestMethod().equals(Methods.POST)) {
            final FormData parsedFormData = parseFormData();
            if (parsedFormData != null) {
                Iterator<String> it = parsedFormData.iterator();
                while (it.hasNext()) {
                    String name = it.next();
                    for(FormData.FormValue param : parsedFormData.get(name)) {
                        if(!param.isFile()) {
                            parameterNames.add(name);
                            break;
                        }
                    }
View Full Code Here

            for (String param : params) {
                ret.add(param);
            }
        }
        if (exchange.getRequestMethod().equals(Methods.POST)) {
            final FormData parsedFormData = parseFormData();
            if (parsedFormData != null) {
                Deque<FormData.FormValue> res = parsedFormData.get(name);
                if (res != null) {
                    for (FormData.FormValue value : res) {
                        if(!value.isFile()) {
                            ret.add(value.getValue());
                        }
View Full Code Here

        for (Map.Entry<String, Deque<String>> entry : queryParameters.entrySet()) {
            arrayMap.put(entry.getKey(), new ArrayList<String>(entry.getValue()));
        }
        if (exchange.getRequestMethod().equals(Methods.POST)) {

            final FormData parsedFormData = parseFormData();
            if (parsedFormData != null) {
                Iterator<String> it = parsedFormData.iterator();
                while (it.hasNext()) {
                    final String name = it.next();
                    Deque<FormData.FormValue> val = parsedFormData.get(name);
                    if (arrayMap.containsKey(name)) {
                        ArrayList<String> existing = arrayMap.get(name);
                        for (final FormData.FormValue v : val) {
                            if(!v.isFile()) {
                                existing.add(v.getValue());
View Full Code Here

            String mimeType = exchange.getRequestHeaders().getFirst(Headers.CONTENT_TYPE);
            if (mimeType != null && mimeType.startsWith(MultiPartParserDefinition.MULTIPART_FORM_DATA)) {
                final ManagedServlet originalServlet = exchange.getAttachment(ServletRequestContext.ATTACHMENT_KEY).getOriginalServletPathMatch().getServletChain().getManagedServlet();
                final FormDataParser parser = originalServlet.getFormParserFactory().createParser(exchange);
                if(parser != null) {
                    final FormData value = parser.parseBlocking();
                    for (final String namedPart : value) {
                        for (FormData.FormValue part : value.get(namedPart)) {
                            parts.add(new PartImpl(namedPart, part, requestContext.getOriginalServletPathMatch().getServletChain().getManagedServlet().getServletInfo().getMultipartConfig(), servletContext));
                        }
                    }
                }
            } else {
View Full Code Here

            queryParameters = exchange.getQueryParameters();
        }
        Deque<String> params = queryParameters.get(name);
        if (params == null) {
            if (exchange.getRequestMethod().equals(Methods.POST)) {
                final FormData parsedFormData = parseFormData();
                if (parsedFormData != null) {
                    FormData.FormValue res = parsedFormData.getFirst(name);
                    if (res == null || res.isFile()) {
                        return null;
                    } else {
                        return res.getValue();
                    }
View Full Code Here

        if (queryParameters == null) {
            queryParameters = exchange.getQueryParameters();
        }
        final Set<String> parameterNames = new HashSet<String>(queryParameters.keySet());
        if (exchange.getRequestMethod().equals(Methods.POST)) {
            final FormData parsedFormData = parseFormData();
            if (parsedFormData != null) {
                Iterator<String> it = parsedFormData.iterator();
                while (it.hasNext()) {
                    String name = it.next();
                    for(FormData.FormValue param : parsedFormData.get(name)) {
                        if(!param.isFile()) {
                            parameterNames.add(name);
                            break;
                        }
                    }
View Full Code Here

            for (String param : params) {
                ret.add(param);
            }
        }
        if (exchange.getRequestMethod().equals(Methods.POST)) {
            final FormData parsedFormData = parseFormData();
            if (parsedFormData != null) {
                Deque<FormData.FormValue> res = parsedFormData.get(name);
                if (res != null) {
                    for (FormData.FormValue value : res) {
                        if(!value.isFile()) {
                            ret.add(value.getValue());
                        }
View Full Code Here

        for (Map.Entry<String, Deque<String>> entry : queryParameters.entrySet()) {
            arrayMap.put(entry.getKey(), new ArrayList<String>(entry.getValue()));
        }
        if (exchange.getRequestMethod().equals(Methods.POST)) {

            final FormData parsedFormData = parseFormData();
            if (parsedFormData != null) {
                Iterator<String> it = parsedFormData.iterator();
                while (it.hasNext()) {
                    final String name = it.next();
                    Deque<FormData.FormValue> val = parsedFormData.get(name);
                    if (arrayMap.containsKey(name)) {
                        ArrayList<String> existing = arrayMap.get(name);
                        for (final FormData.FormValue v : val) {
                            if(!v.isFile()) {
                                existing.add(v.getValue());
View Full Code Here

TOP

Related Classes of io.undertow.server.handlers.form.FormData

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.