docs: private String getVfsName(String relativeName, String name, boolean isFile) throws Exception {
  
          // first translate all file-separators to the valid "/" in OpenCms
          String vfsName = relativeName.replace('\\', '/');
          // the resource is a file
          if (isFile) {
              // we must check if it might be copied into a gallery. this can be done by checking the
              // file extension
              int filetype = getFileType(name);
  
              // there is no name before the ".extension"
              if (name.indexOf(".") == 0) {
                  name = "unknown" + name;
                  int dot = relativeName.lastIndexOf(".");
  
                  relativeName = relativeName.substring(0, dot) + name;
              }
  
              // depending on the file-type, the resource must be moved into a special folder in
              // OpenCms:
              // images -> move into image gallery, if flag to leave at original location is off
              // binary -> move into download gallery, if flag to leave at original location is off
              // plain -> move into destination folder
              // other -> move into download gallery, if flag to leave at original location is off
              boolean leaveImages = CmsStringUtil.isEmptyOrWhitespaceOnly(m_imageGallery);
              boolean leaveDownload = CmsStringUtil.isEmptyOrWhitespaceOnly(m_downloadGallery);
              int imageId = OpenCms.getResourceManager().getResourceType(
                  CmsResourceTypeImage.getStaticTypeName()).getTypeId();
              int plainId = OpenCms.getResourceManager().getResourceType(
                  CmsResourceTypePlain.getStaticTypeName()).getTypeId();
              if ((imageId == filetype) && (!leaveImages)) {
                  // move to image gallery
                  // as the image gallery is "flat", we must use the file name and not the complete
                  // relative name
                  vfsName = m_imageGallery + name;
              } else if ((plainId == filetype) || (leaveImages) || (leaveDownload)) {
                  // move to destination folder
                  //vfsName=m_destinationDir+relativeName;
  
                  // we have to check if there is a folder with the same name but without extension
                  // if so, we will move the file into the folder and name it "index.html"
                  String folderName = relativeName;
                  if (folderName.indexOf(".") > 0) {
                      folderName = folderName.substring(0, folderName.indexOf("."));
                  }
                  folderName = m_inputDir + "\\" + folderName;
                  File folder = new File(folderName);
  
                  if (folder.isDirectory()) {
                      vfsName = m_destinationDir + relativeName.substring(0, relativeName.indexOf(".")) + "/index.html";
                      // System.err.println("MOVING "+ relativeName + " -> " + name.substring(0,name.indexOf("."))+"/index.html");
                  } else {
                      // move to destination folder
                      vfsName = m_destinationDir + relativeName;
                  }
  
              } else {
                  // everything else will be moved to the download gallery.
                  // as the download gallery is "flat", we must use the file name and not the complete
                  // relative name
                  vfsName = m_downloadGallery + name;
              }
              // now we have the filename in the VFS. its possible that a file with the same name
              // is already existing, in this case, we have to adjust the filename.
              return validateFilename(vfsName);
          } else {
              // folders are always moved to the destination folder
              vfsName = m_destinationDir + vfsName + "/";
              return vfsName;
          }
      }