code: public CmsResource createResource(
          String sitePath,
          CmsResource resource,
          byte[] content,
          List<CmsProperty> properties)
      throws CmsException {
  
          resource.setUserLastModified(getRequestContext().getCurrentUser().getId());
          resource.setDateLastModified(System.currentTimeMillis());
          // ensure resource record is updated
          resource.setState(CmsResource.STATE_NEW);
          return m_securityManager.createResource(
              m_context,
              m_context.addSiteRoot(sitePath),
              resource,
              content,
              properties);
      }
docs: Creates a resource with the given properties and content.
  Will throw an exception, if a resource with the given name already exists.<p>
  
  @param sitePath the site path for the resource
  @param resource the resource object to be imported
  @param content the content of the resource
  @param properties the properties of the resource
  
  @return the imported resource
  
  @throws CmsException if something goes wrong