code: public CmsResource createResource(
          CmsRequestContext context,
          String resourcePath,
          CmsResource resource,
          byte[] content,
          List<CmsProperty> properties)
      throws CmsVfsResourceAlreadyExistsException, CmsVfsException, CmsException {
  
          if (existsResource(context, resourcePath, CmsResourceFilter.IGNORE_EXPIRATION)) {
              // check if the resource already exists by name
              throw new CmsVfsResourceAlreadyExistsException(
                  org.opencms.db.generic.Messages.get().container(
                      org.opencms.db.generic.Messages.ERR_RESOURCE_WITH_NAME_ALREADY_EXISTS_1,
                      resource.getRootPath()));
          }
          CmsDbContext dbc = m_dbContextFactory.getDbContext(context);
          CmsResource newResource = null;
          try {
              checkOfflineProject(dbc);
              newResource = m_driverManager.createResource(dbc, resourcePath, resource, content, properties, false);
          } catch (Exception e) {
              dbc.report(
                  null,
                  Messages.get().container(Messages.ERR_IMPORT_RESOURCE_2, context.getSitePath(resource), resourcePath),
                  e);
          } finally {
              dbc.clear();
          }
          return newResource;
      }
docs: Creates a new resource with the provided content and properties.<p>
  An exception is thrown if a resource with the given name already exists.<p>
  
  @param context the current request context
  @param resourcePath the name of the resource to create (full path)
  @param resource the new resource to create
  @param content the content for the new resource
  @param properties the properties for the new resource
  
  @return the created resource
  
  @throws CmsVfsResourceAlreadyExistsException if a resource with the given name already exists
  @throws CmsVfsException if the project in the given database context is the "Online" project
  @throws CmsException if something goes wrong