return 0;
}
@Override
protected void doDecode(FacesContext context, UIComponent component) {
final AbstractFileUpload fileUpload = (AbstractFileUpload) component;
final ExternalContext externalContext = context.getExternalContext();
Object request = externalContext.getRequest();
if (request instanceof HttpServletRequest) {
HttpServletRequest httpRequest = (HttpServletRequest) request;
if (httpRequest.getContentType() != null && httpRequest.getContentType().startsWith("multipart/")) {
String uid = MultipartRequestParser.getParameterValueFromQueryString(httpRequest.getQueryString());
if (uid != null) {
long contentLength = Long.parseLong(httpRequest.getHeader("Content-Length"));
long maxRequestSize = getMaxRequestSize(httpRequest.getServletContext());
if (maxRequestSize != 0 && contentLength > maxRequestSize) {
externalContext.setResponseStatus(HttpServletResponse.SC_REQUEST_ENTITY_TOO_LARGE);
return;
}
Iterable<UploadedFile> uploadedFiles = initializeUploadedFiles(externalContext, httpRequest, uid);
for (UploadedFile file : uploadedFiles) {
if (fileUpload.acceptsFile(file)) {
fileUpload.queueEvent(new FileUploadEvent(fileUpload, file));
}
}
}
}
}