Search in sources :

Example 1 with IteratorEnumeration

use of io.undertow.servlet.util.IteratorEnumeration in project undertow by undertow-io.

the class HttpServletRequestImpl method getParameterNames.

@Override
public Enumeration<String> getParameterNames() {
    if (queryParameters == null) {
        queryParameters = exchange.getQueryParameters();
    }
    final Set<String> parameterNames = new HashSet<>(queryParameters.keySet());
    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.isFileItem()) {
                    parameterNames.add(name);
                    break;
                }
            }
        }
    }
    return new IteratorEnumeration<>(parameterNames.iterator());
}
Also used : FormData(io.undertow.server.handlers.form.FormData) IteratorEnumeration(io.undertow.servlet.util.IteratorEnumeration) HttpString(io.undertow.util.HttpString) HashSet(java.util.HashSet)

Aggregations

FormData (io.undertow.server.handlers.form.FormData)1 IteratorEnumeration (io.undertow.servlet.util.IteratorEnumeration)1 HttpString (io.undertow.util.HttpString)1 HashSet (java.util.HashSet)1