private MultipartParsingResult parseRequest ( HttpRequest request ) throws MultipartException { String encoding = determineEncoding ( request ) ; FileUpload fileUpload = prepareFileUpload ( encoding ) ; try { RequestBody body = request . getBody ( ) ; Assert . notNull ( body , "The body cannot be null." ) ; List < FileItem > fileItems = fileUpload . parseRequest ( new BodyContext ( body ) ) ; return parseFileItems ( fileItems , encoding ) ; } catch ( FileUploadBase . SizeLimitExceededException ex ) { throw new MaxUploadSizeExceededException ( fileUpload . getSizeMax ( ) , ex ) ; } catch ( FileUploadBase . FileSizeLimitExceededException ex ) { throw new MaxUploadSizeExceededException ( fileUpload . getFileSizeMax ( ) , ex ) ; } catch ( FileUploadException ex ) { throw new MultipartException ( "Failed to parse multipart servlet request." , ex ) ; } }
Parse the given request resolving its multipart elements .