final Map<String, MultipartDataSource[]> multipartDataSources = new HashMap<String, MultipartDataSource[]>(multipartFiles.size());
for (final Map.Entry<String, MultipartFile> multipartFileEntry : multipartFiles.entrySet()) {
final MultipartFile multipartFile = multipartFileEntry.getValue();
if (StringUtils.isNotEmpty(multipartFile.getOriginalFilename())) {
final MultipartDataSource multipartDataSource = new MultipartDataSource(multipartFile);
multipartDataSources.put(multipartFileEntry.getKey(), new MultipartDataSource[] { multipartDataSource });
}
}
return multipartDataSources;