docs: private CmsResource importResource(
          String source,
          String destination,
          String type,
          String uuidresource,
          long datelastmodified,
          String userlastmodified,
          long datecreated,
          String usercreated,
          String flags,
          List<CmsProperty> properties) {
  
          byte[] content = null;
          CmsResource result = null;
  
          try {
  
              // get the file content
              if (source != null) {
                  content = getFileBytes(source);
              }
              int size = 0;
              if (content != null) {
                  size = content.length;
              }
  
              // get all required information to create a CmsResource
              I_CmsResourceType resType;
  
              // get UUIDs for the user
              CmsUUID newUserlastmodified;
              CmsUUID newUsercreated;
              // check if user created and user lastmodified are valid users in this system.
              // if not, use the current user
              try {
                  newUserlastmodified = m_cms.readUser(userlastmodified).getId();
              } catch (CmsException e) {
                  newUserlastmodified = m_cms.getRequestContext().getCurrentUser().getId();
                  // datelastmodified = System.currentTimeMillis();
              }
  
              try {
                  newUsercreated = m_cms.readUser(usercreated).getId();
              } catch (CmsException e) {
                  newUsercreated = m_cms.getRequestContext().getCurrentUser().getId();
                  // datecreated = System.currentTimeMillis();
              }
  
              // convert to xml page if wanted
              if (m_convertToXmlPage && (type.equals(RESOURCE_TYPE_NEWPAGE_NAME))) {
  
                  if (content != null) {
  
                      //get the encoding
                      String encoding = null;
                      encoding = CmsProperty.get(CmsPropertyDefinition.PROPERTY_CONTENT_ENCODING, properties).getValue();
                      if (encoding == null) {
                          encoding = OpenCms.getSystemInfo().getDefaultEncoding();
                      }
  
                      CmsXmlPage xmlPage = CmsXmlPageConverter.convertToXmlPage(
                          m_cms,
                          content,
                          getLocale(destination, properties),
                          encoding);
  
                      content = xmlPage.marshal();
                  }
                  resType = OpenCms.getResourceManager().getResourceType(CmsResourceTypeXmlPage.getStaticTypeId());
              } else if (type.equals(RESOURCE_TYPE_LINK_NAME)) {
                  resType = OpenCms.getResourceManager().getResourceType(CmsResourceTypePointer.getStaticTypeId());
              } else if (type.equals(RESOURCE_TYPE_LEGACY_PAGE_NAME)) {
                  resType = OpenCms.getResourceManager().getResourceType(CmsResourceTypePlain.getStaticTypeId());
              } else {
                  resType = OpenCms.getResourceManager().getResourceType(type);
              }
  
              // get UUIDs for the resource and content
              CmsUUID newUuidresource = null;
              if ((uuidresource != null) && (!resType.isFolder())) {
                  // create a UUID from the provided string
                  newUuidresource = new CmsUUID(uuidresource);
              } else {
                  // folders get always a new resource record UUID
                  newUuidresource = new CmsUUID();
              }
  
              // create a new CmsResource
              CmsResource resource = new CmsResource(
                  new CmsUUID(), // structure ID is always a new UUID
                  newUuidresource,
                  destination,
                  resType.getTypeId(),
                  resType.isFolder(),
                  new Integer(flags).intValue(),
                  m_cms.getRequestContext().getCurrentProject().getUuid(),
                  CmsResource.STATE_NEW,
                  datecreated,
                  newUsercreated,
                  datelastmodified,
                  newUserlastmodified,
                  CmsResource.DATE_RELEASED_DEFAULT,
                  CmsResource.DATE_EXPIRED_DEFAULT,
                  1,
                  size,
                  System.currentTimeMillis(),
                  0);
  
              if (type.equals(RESOURCE_TYPE_LINK_NAME)) {
                  // store links for later conversion
                  m_report.print(Messages.get().container(Messages.RPT_STORING_LINK_0), I_CmsReport.FORMAT_NOTE);
                  m_linkStorage.put(m_importPath + destination, new String(content));
                  m_linkPropertyStorage.put(m_importPath + destination, properties);
                  result = resource;
              } else {
                  // import this resource in the VFS
                  result = m_cms.importResource(destination, resource, content, properties);
              }
  
              if (result != null) {
                  m_report.println(
                      org.opencms.report.Messages.get().container(org.opencms.report.Messages.RPT_OK_0),
                      I_CmsReport.FORMAT_OK);
              }
          } catch (Exception exc) {
              // an error while importing the file
              m_report.println(exc);
              m_report.addError(exc);
  
              try {
                  // Sleep some time after an error so that the report output has a chance to keep up
                  Thread.sleep(1000);
              } catch (Exception e) {
                  //
              }
          }
  
          return result;
      }