}
@Override
protected void doDecode(FacesContext context, UIComponent component)
{
UIFileUpload fileUpload = (UIFileUpload) component;
ServletRequest request = (ServletRequest) context.getExternalContext().getRequest();
if (!(request instanceof MultipartRequest))
{
request = unwrapMultipartRequest(request);
}
if (request instanceof MultipartRequest)
{
MultipartRequest multipartRequest = (MultipartRequest) request;
String clientId = component.getClientId(context);
fileUpload.setLocalInputStream(multipartRequest.getFileInputStream(clientId));
fileUpload.setLocalContentType(multipartRequest.getFileContentType(clientId));
fileUpload.setLocalFileName(multipartRequest.getFileName(clientId));
fileUpload.setLocalFileSize(multipartRequest.getFileSize(clientId));
}
}