docs: private void createFile(String filename, int position, String content, Hashtable properties) {
  
          String vfsFileName = (String)m_fileIndex.get(filename.replace('\\', '/'));
  
          if (vfsFileName != null) {
              try {
  
                  m_report.print(Messages.get().container(Messages.RPT_CREATE_FILE_0), I_CmsReport.FORMAT_NOTE);
                  m_report.print(
                      org.opencms.report.Messages.get().container(
                          org.opencms.report.Messages.RPT_ARGUMENT_1,
                          vfsFileName));
                  m_report.print(org.opencms.report.Messages.get().container(org.opencms.report.Messages.RPT_DOTS_0));
  
                  // check if we have to set the navpos property.
                  if ((properties.get(CmsPropertyDefinition.PROPERTY_NAVPOS) == null)
                      && (properties.get(CmsPropertyDefinition.PROPERTY_NAVTEXT) != null)) {
                      // set the position in the folder as navpos
                      // we have to add one to the position, since it is counted from 0
                      properties.put(CmsPropertyDefinition.PROPERTY_NAVPOS, (position + 1) + "");
                  }
  
                  // create new XML page
                  Locale locale = CmsLocaleManager.getLocale(m_locale);
                  CmsXmlPage page = new CmsXmlPage(locale, OpenCms.getSystemInfo().getDefaultEncoding());
                  page.addValue(m_element, locale);
                  page.setStringValue(m_cmsObject, m_element, locale, content);
  
                  // check links
                  CmsLinkTable linkTable = page.getLinkTable(m_element, locale);
                  Iterator i = linkTable.iterator();
                  while (i.hasNext()) {
                      CmsLink link = (CmsLink)i.next();
                      String target = link.getTarget();
                      // do only update internal links
                      if (link.isInternal()) {
                          target = m_cmsObject.getRequestContext().getFileTranslator().translateResource(target);
                          // update link
                          link.updateLink(target, link.getAnchor(), link.getQuery());
                          link.checkConsistency(m_cmsObject);
                      }
                  }
                  // marshal XML page and get the content
                  byte[] contentByteArray = page.marshal();
                  List oldProperties = new ArrayList();
  
                  int xmlPageId = OpenCms.getResourceManager().getResourceType(
                      CmsResourceTypeXmlPage.getStaticTypeName()).getTypeId();
                  if (!m_overwrite) {
                      m_cmsObject.createResource(vfsFileName, xmlPageId, contentByteArray, new ArrayList());
                  } else {
                      try {
                          // try if the file is there
                          oldProperties = m_cmsObject.readPropertyObjects(vfsFileName, false);
                          CmsLock lock = m_cmsObject.getLock(vfsFileName);
                          if (lock.getType() != CmsLockType.EXCLUSIVE) {
                              m_cmsObject.lockResource(vfsFileName);
                          }
                          m_cmsObject.deleteResource(vfsFileName, CmsResource.DELETE_PRESERVE_SIBLINGS);
                      } catch (CmsException e) {
                          // the file did not exist, so we do not have to delete it
                      } finally {
                          // create the new resource
                          m_report.print(Messages.get().container(Messages.RPT_OVERWRITE_0), I_CmsReport.FORMAT_NOTE);
                          m_report.print(
                              org.opencms.report.Messages.get().container(org.opencms.report.Messages.RPT_DOTS_0));
                          m_cmsObject.createResource(vfsFileName, xmlPageId, contentByteArray, new ArrayList());
                      }
                  }
                  // create all properties and put them in an ArrayList
                  Iterator it = properties.entrySet().iterator();
                  List propertyList = new ArrayList();
                  while (it.hasNext()) {
                      // get property and value
                      Map.Entry entry = (Map.Entry)it.next();
                      String propertyKey = (String)entry.getKey();
                      String propertyVal = (String)entry.getValue();
                      // create new Property Object
                      CmsProperty property = new CmsProperty(propertyKey, propertyVal, propertyVal);
                      // create implicitly if Property doesn't exist already
                      property.setAutoCreatePropertyDefinition(true);
                      // add new property to the list
                      propertyList.add(property);
                  }
                  // try to write the properties
                  try {
                      m_cmsObject.writePropertyObjects(vfsFileName, propertyList);
                      // write the old properties if available
                      m_cmsObject.writePropertyObjects(vfsFileName, oldProperties);
                  } catch (CmsException e1) {
                      e1.printStackTrace();
                  }
                  m_report.println(
                      org.opencms.report.Messages.get().container(org.opencms.report.Messages.RPT_OK_0),
                      I_CmsReport.FORMAT_OK);
              } catch (CmsException e) {
                  m_report.println(e);
                  LOG.error(e.getLocalizedMessage(), e);
              }
          }
      }