public RequestParameterMapFactory(BridgeContext bridgeContext) {

    PortletRequest portletRequest = bridgeContext.getPortletRequest();

    if (portletRequest instanceof ClientDataRequest) {
      ClientDataRequest clientDataRequest = (ClientDataRequest) portletRequest;
      String contentType = clientDataRequest.getContentType();

      // Note that ICEfaces ace:fileEntry cannot rely on RequestParameterValuesMapImpl because it
      // relies on its
      // own mechanism for handling file upload.
      Product iceFaces = ProductMap.getInstance().get(ProductConstants.ICEFACES);

      if ((contentType != null)
          && contentType.toLowerCase().startsWith(BridgeConstants.MULTIPART_CONTENT_TYPE_PREFIX)
          && !iceFaces.isDetected()) {
        RequestParameterMapMultiPartImpl requestParameterMapMultiPartImpl =
            new RequestParameterMapMultiPartImpl(bridgeContext, clientDataRequest);
        requestParameterMap = requestParameterMapMultiPartImpl;
        requestParameterValuesMap =
            new RequestParameterValuesMapMultiPartImpl(requestParameterMapMultiPartImpl);
      } else {
        requestParameterMap = new RequestParameterMapImpl(bridgeContext);
        requestParameterValuesMap = new RequestParameterValuesMapImpl(bridgeContext);
      }
    } else {
      requestParameterMap = new RequestParameterMapImpl(bridgeContext);
      requestParameterValuesMap = new RequestParameterValuesMapImpl(bridgeContext);
    }
  }
  protected boolean isICEfacesLegacyMode(ClientDataRequest clientDataRequest) {

    if (iceFacesLegacyMode == null) {

      iceFacesLegacyMode = Boolean.FALSE;

      String requestContentType = clientDataRequest.getContentType();

      if ((requestContentType != null)
          && requestContentType
              .toLowerCase()
              .startsWith(BridgeConstants.MULTIPART_CONTENT_TYPE_PREFIX)) {

        Product iceFaces = ProductMap.getInstance().get(ProductConstants.ICEFACES);

        if (iceFaces.isDetected()
            && ((iceFaces.getMajorVersion() == 2)
                || ((iceFaces.getMajorVersion() == 3) && (iceFaces.getMinorVersion() == 0)))) {

          iceFacesLegacyMode = Boolean.TRUE;
        }
      }
    }

    return iceFacesLegacyMode;
  }