class MapMultipartFormDataMessageBodyReader implements MessageBodyReader<Map<String, InputItem>> {

    @Override
    public Map<String, InputItem> readFrom(Class<Map<String, InputItem>> type, Type genericType, Annotation[] annotations,
                                           MediaType mediaType, MultivaluedMap<String, String> httpHeaders, InputStream entityStream)
            throws IOException, WebApplicationException {
        final Type genericSuperclass = ParameterizedTypeImpl.newParameterizedType(Iterator.class, FileItem.class);
        final MessageBodyReader<Iterator> multipartReader =
                providers.getMessageBodyReader(Iterator.class, genericSuperclass, annotations, mediaType);
        final Iterator iterator =
                multipartReader.readFrom(Iterator.class, genericSuperclass, annotations, mediaType, httpHeaders, entityStream);
        final Map<String, InputItem> result = new LinkedHashMap<>();
        while (iterator.hasNext()) {
            final DefaultInputItem item = new DefaultInputItem((FileItem)iterator.next(), providers);
            result.put(item.getName(), item);
        }
        return result;
    }

    public  MapMultipartFormDataMessageBodyReader(@Context Providers providers);

}