class MultiPartFileParser {

    public String parseMultiPartFiles(final List<FileItem> fields) throws IOException {
        String msg = "";
        Iterator<FileItem> it = fields.iterator();
        if (!fields.isEmpty() && it.hasNext()) {
            while (it.hasNext()) {
                FileItem fileItem = it.next();
                if (!fileItem.isFormField()) {
                    String uploadedFileName = fileItem.getName();
                    InputStream uploadedResource = fileItem.getInputStream();
                    String contentType = fileItem.getContentType();
                    String fieldName = fileItem.getFieldName();
                    msg += multiPartFileProcessor.processUploadedFile(uploadedResource, contentType, fieldName, uploadedFileName);
                }
            }
        } else {
            msg = "No file uploaded";
        }

        return msg;
    }

    @Autowired public  MultiPartFileParser(final MultiPartFileProcessor multiPartFileProcessor);

}