code: @Override
      public RequestContent getRequestContent(HttpServletRequest request,
                                              HttpHeaders headers)
          throws Exception {
          RequestContent rContent = null;
  
          // See if the request is a multi-part file upload request
          if (ServletFileUpload.isMultipartContent(request)) {
  
              // Create a new file upload handler
              ServletFileUpload upload = new ServletFileUpload();
  
              // Parse the request, use the first available File item
              FileItemIterator iter = upload.getItemIterator(request);
              while (iter.hasNext()) {
                  FileItemStream item = iter.next();
                  if (!item.isFormField()) {
                      rContent = new RequestContent();
                      rContent.contentStream = item.openStream();
                      rContent.mimeType = item.getContentType();
  
                      FileItemHeaders itemHeaders = item.getHeaders();
                      if (itemHeaders != null) {
                          String contentLength =
                              itemHeaders.getHeader("Content-Length");
                          if (contentLength != null) {
                              rContent.size = Long.parseLong(contentLength);
                          }
                      }
  
                      break;
                  }
              }
          } else {
              // If the content stream was not found as a multipart,
              // try to use the stream from the request directly
              rContent = new RequestContent();
              rContent.contentStream = request.getInputStream();
              if (request.getContentLength() >= 0) {
                  rContent.size = request.getContentLength();
              }
          }
  
          // Attempt to set the mime type and size if not already set
          if (rContent != null) {
              if (rContent.mimeType == null) {
                  MediaType mediaType = headers.getMediaType();
                  if (mediaType != null) {
                      rContent.mimeType = mediaType.toString();
                  }
              }
  
              if (rContent.size == 0) {
                  List<String> lengthHeaders =
                      headers.getRequestHeader("Content-Length");
                  if (lengthHeaders != null && lengthHeaders.size() > 0) {
                      rContent.size = Long.parseLong(lengthHeaders.get(0));
                  }
              }
          }
  
          return rContent;
      }
docs: Retrieves the contents of the HTTP Request.
  
  @return InputStream from the request