code: public static Object getNewResourceHandler(
          String type,
          String defaultClassName,
          PageContext context,
          HttpServletRequest req,
          HttpServletResponse res)
      throws CmsRuntimeException {
  
          if (CmsStringUtil.isEmpty(type)) {
              // it's not possible to hardwire the resource type name on the JSP for Xml content types
              type = req.getParameter(PARAM_NEWRESOURCETYPE);
          }
  
          String className = defaultClassName;
          CmsExplorerTypeSettings settings = OpenCms.getWorkplaceManager().getExplorerTypeSetting(type);
  
          Class<?> clazz = null;
          try {
              clazz = Class.forName(className);
          } catch (ClassNotFoundException e) {
  
              if (LOG.isErrorEnabled()) {
                  LOG.error(Messages.get().getBundle().key(Messages.ERR_NEW_RES_HANDLER_CLASS_NOT_FOUND_1, className), e);
              }
              throw new CmsIllegalArgumentException(
                  Messages.get().container(Messages.ERR_NEW_RES_HANDLER_CLASS_NOT_FOUND_1, className));
          }
  
          Object handler = null;
          try {
              Constructor<?> constructor = clazz.getConstructor(
                  new Class[] {PageContext.class, HttpServletRequest.class, HttpServletResponse.class});
              handler = constructor.newInstance(new Object[] {context, req, res});
          } catch (Exception e) {
  
              throw new CmsIllegalArgumentException(
                  Messages.get().container(Messages.ERR_NEW_RES_CONSTRUCTOR_NOT_FOUND_1, className));
          }
  
          return handler;
      }
docs: A factory to return handlers to create new resources.<p>
  
  @param type the resource type name to get a new resource handler for, as specified in the explorer type settings
  @param defaultClassName a default handler class name, to be used if the handler class specified in the explorer type settings cannot be found
  @param context the JSP page context
  @param req the JSP request
  @param res the JSP response
  @return a new instance of the handler class
  @throws CmsRuntimeException if something goes wrong