factory.setRepository(new File(tmpDir));
ServletFileUpload _upload = new ServletFileUpload(factory);
_upload.setSizeMax(sizeMax);
if (upload != null){
Class<?> clazz = upload.listener();
if (!void.class.isAssignableFrom(clazz) && ProgressListener.class.isAssignableFrom(clazz))
_upload.setProgressListener((ProgressListener) clazz.newInstance());
}
try{