docs: public void validate(FileItem fi, boolean isdefault) throws CmsIllegalArgumentException {
  
          // check the input directory and the HTTP upload file
          if (fi == null) {
  
              if (CmsStringUtil.isEmptyOrWhitespaceOnly(m_inputDir) && !isdefault) {
                  throw new CmsIllegalArgumentException(
                      Messages.get().container(Messages.GUI_HTMLIMPORT_INPUTDIR_1, m_inputDir));
              } else if (!CmsStringUtil.isEmptyOrWhitespaceOnly(m_inputDir)) {
  
                  File inputDir = new File(m_inputDir);
                  if (!inputDir.exists() || inputDir.isFile()) {
                      throw new CmsIllegalArgumentException(
                          Messages.get().container(Messages.GUI_HTMLIMPORT_INPUTDIR_1, m_inputDir));
                  }
              }
          }
  
          // check the destination directory
          try {
              if (CmsStringUtil.isEmptyOrWhitespaceOnly(m_destinationDir) && !isdefault) {
                  throw new CmsIllegalArgumentException(
                      Messages.get().container(Messages.GUI_HTMLIMPORT_DESTDIR_1, m_destinationDir));
              } else if (!CmsStringUtil.isEmptyOrWhitespaceOnly(m_destinationDir)) {
                  m_cmsObject.readFolder(m_destinationDir);
              }
  
          } catch (CmsException e) {
              // an exception is thrown if the folder does not exist
              throw new CmsIllegalArgumentException(
                  Messages.get().container(Messages.GUI_HTMLIMPORT_DESTDIR_1, m_destinationDir),
                  e);
          }
  
          // check the image gallery
          // only if flag for leaving images at original location is off
          if (!CmsStringUtil.isEmptyOrWhitespaceOnly(m_imageGallery)) {
              try {
                  CmsFolder folder = m_cmsObject.readFolder(m_imageGallery);
                  // check if folder is a image gallery
                  String name = OpenCms.getResourceManager().getResourceType(folder.getTypeId()).getTypeName();
                  if (!name.equals("imagegallery")) {
                      throw new CmsIllegalArgumentException(
                          Messages.get().container(Messages.GUI_HTMLIMPORT_IMGGALLERY_INVALID_1, m_imageGallery));
                  }
              } catch (CmsException e) {
                  // an exception is thrown if the folder does not exist
                  throw new CmsIllegalArgumentException(
                      Messages.get().container(Messages.GUI_HTMLIMPORT_IMGGALLERY_1, m_imageGallery),
                      e);
              }
          }
  
          // check the link gallery
          // only if flag for leaving external links at original location is off
          if (!CmsStringUtil.isEmptyOrWhitespaceOnly(m_linkGallery)) {
              try {
                  CmsFolder folder = m_cmsObject.readFolder(m_linkGallery);
                  // check if folder is a link gallery
                  String name = OpenCms.getResourceManager().getResourceType(folder.getTypeId()).getTypeName();
                  if (!name.equals("linkgallery")) {
                      throw new CmsIllegalArgumentException(
                          Messages.get().container(Messages.GUI_HTMLIMPORT_LINKGALLERY_INVALID_1, m_linkGallery));
                  }
              } catch (CmsException e) {
                  // an exception is thrown if the folder does not exist
                  throw new CmsIllegalArgumentException(
                      Messages.get().container(Messages.GUI_HTMLIMPORT_LINKGALLERY_1, m_linkGallery),
                      e);
              }
          }
  
          // check the download gallery
          if ((!isExternal(m_downloadGallery)) && (!CmsStringUtil.isEmptyOrWhitespaceOnly(m_downloadGallery))) {
              try {
                  CmsFolder folder = m_cmsObject.readFolder(m_downloadGallery);
                  // check if folder is a download gallery
                  String name = OpenCms.getResourceManager().getResourceType(folder.getTypeId()).getTypeName();
                  if (!name.equals("downloadgallery")) {
                      throw new CmsIllegalArgumentException(
                          Messages.get().container(Messages.GUI_HTMLIMPORT_DOWNGALLERY_INVALID_1, m_downloadGallery));
                  }
              } catch (CmsException e) {
                  // an exception is thrown if the folder does not exist
                  throw new CmsIllegalArgumentException(
                      Messages.get().container(Messages.GUI_HTMLIMPORT_DOWNGALLERY_1, m_downloadGallery),
                      e);
              }
          }
  
          // check the template
          try {
              m_cmsObject.readResource(m_template, CmsResourceFilter.ALL);
          } catch (CmsException e) {
              // an exception is thrown if the template does not exist
              if (!isValidElement()) {
                  throw new CmsIllegalArgumentException(
                      Messages.get().container(Messages.GUI_HTMLIMPORT_TEMPLATE_1, m_template),
                      e);
              }
          }
  
          // check the element
          if (!isValidElement()) {
              throw new CmsIllegalArgumentException(
                  Messages.get().container(Messages.GUI_HTMLIMPORT_INVALID_ELEM_2, m_element, m_template));
          }
  
          // check if we are in an offline project
          if (m_cmsObject.getRequestContext().getCurrentProject().isOnlineProject()) {
              throw new CmsIllegalArgumentException(
                  Messages.get().container(Messages.GUI_HTMLIMPORT_CONSTRAINT_OFFLINE_0));
          }
      }