List of usage examples for org.springframework.web.multipart MaxUploadSizeExceededException getMaxUploadSize
public long getMaxUploadSize()
From source file:com.iisigroup.cap.operation.step.CapFileUploadOpStep.java
protected MultipartHttpServletRequest uploadFile(IRequest params) { if (params.containsKey("limitSize")) { multipartResolver.setMaxUploadSize(params.getParamsAsInteger("limitSize")); }//from www. j av a 2 s .c o m if (params.containsKey("fileEncoding")) { multipartResolver.setDefaultEncoding(params.get("fileEncoding")); } try { return multipartResolver.resolveMultipart((HttpServletRequest) params.getServletRequest()); } catch (MaxUploadSizeExceededException fe) { CapMessageException me = new CapMessageException(fileSizeLimitErrorCode, getClass()); Object[] extra = new Object[] { CapMath.divide(String.valueOf(fe.getMaxUploadSize()), "1048576", 2) }; me.setMessageKey(fileSizeLimitErrorCode); me.setExtraInformation(extra); throw me; } catch (MultipartException e) { throw new CapException(e, getClass()); } }