code: private RequestContext createRequestContext(final HttpServletRequest req) {
          return new RequestContext() {
              @Override
              public String getCharacterEncoding() {
                  return req.getCharacterEncoding();
              }
  
              @Override
              public String getContentType() {
                  return req.getContentType();
              }
  
              @Override
              @Deprecated
              public int getContentLength() {
                  return req.getContentLength();
              }
  
              @Override
              public InputStream getInputStream() throws IOException {
                  return req.getInputStream();
              }
          };
      }
docs: Creates a RequestContext needed by Jakarta Commons Upload.
  
  @param req the HTTP request
  @return a new request context