code: private void setTemplate(CmsResource siteRootResource) {
  
          try {
              m_cms.lockResource(siteRootResource);
              // add template  property
              if (CmsStringUtil.isNotEmptyOrWhitespaceOnly(m_template)) {
                  CmsProperty prop = new CmsProperty(CmsPropertyDefinition.PROPERTY_TEMPLATE, m_template, m_template);
                  m_cms.writePropertyObject(siteRootResource.getRootPath(), prop);
              }
              m_cms.unlockResource(siteRootResource);
          } catch (CmsException e) {
              LOG.error("Error on adding template", e);
          }
      }
docs: Sets the selected template as property to site root folder.<p>
  
  @param siteRootResource Resource representing root folder