File tmpDir = new File(tempDirectory);
if (tmpDir.exists() && tmpDir.isDirectory()){
factory.setRepository(tmpDir);
}
}
ServletFileUpload upload = new ServletFileUpload(factory);
if (maxFileSize > 0){
upload.setFileSizeMax(maxFileSize);
}
Map<String,List<String>> tmpParams = new HashMap<String,List<String>>();
Map<String,List<MultipartFile>> tmpFiles = new HashMap<String,List<MultipartFile>>();
List<?> items = upload.parseRequest(request);
for(Object itemObject: items){
FileItem item = (FileItem)itemObject;
if (item.isFormField()){
List<String> list1 = tmpParams.get(item.getFieldName());
if (list1 == null){