Class klass) {
MultivaluedMap<String, Object> formFields = new MultivaluedMapImpl<String, Object>();
Iterator<InPart> partIter = multiPartForm.getParts().iterator();
while(partIter.hasNext()) {
InPart formPart = partIter.next();
String formPartName = getFormPartName(formPart);
if (formPartName != null) {
try {
// Extract part body and store in response map
Object formPartValue = formPart.getBody(klass, null);
if (formPartValue != null) {
formFields.add(formPartName, formPartValue);
}
} catch (IOException e) {