use of org.apache.commons.fileupload.disk.DiskFileItemFactory in project JessMA by ldcsaa.
the class FileUploader method getFileUploadComponent.
private ServletFileUpload getFileUploadComponent() {
DiskFileItemFactory dif = new DiskFileItemFactory();
if (factorySizeThreshold != DEFAULT_SIZE_THRESHOLD)
dif.setSizeThreshold(factorySizeThreshold);
if (factoryRepository != null)
dif.setRepository(new File(factoryRepository));
if (factoryCleaningTracker != null)
dif.setFileCleaningTracker(factoryCleaningTracker);
ServletFileUpload sfu = new ServletFileUpload(dif);
if (sizeMax != NO_LIMIT_SIZE_MAX)
sfu.setSizeMax(sizeMax);
if (fileSizeMax != NO_LIMIT_FILE_SIZE_MAX)
sfu.setFileSizeMax(fileSizeMax);
if (servletHeaderencoding != null)
sfu.setHeaderEncoding(servletHeaderencoding);
if (servletProgressListener != null)
sfu.setProgressListener(servletProgressListener);
return sfu;
}
Aggregations