protected void initFilterBean() throws ServletException {
if (multipartResolver == null) {
try {
ClassUtils.getClass("org.apache.commons.fileupload.FileItemFactory");
RequestMultipartResolver requestMultipartResolver = new RequestMultipartResolver();
Object maxInMemorySize = ResourceUtils.getProperty("app.maxInMemorySize");
if (maxInMemorySize != null) {
requestMultipartResolver.setMaxInMemorySize((Integer) maxInMemorySize);
}
Object maxUploadSize = ResourceUtils.getProperty("app.maxUploadSize");
if (maxUploadSize != null) {
requestMultipartResolver.setMaxUploadSize((Integer) maxUploadSize);
}
multipartResolver = requestMultipartResolver;
} catch (ClassNotFoundException e) {
}
}