code: private void saveFavIcon(String siteRoot) {
  
          if (m_os == null) {
              return;
          }
          if (m_os.size() == 0) {
              return;
          }
  
          getReport().println(Messages.get().container(Messages.RPT_SITE_SET_FAVICON_0), I_CmsReport.FORMAT_DEFAULT);
          CmsResource favicon = null;
          try {
              favicon = m_cms.createResource(
                  siteRoot + CmsSiteManager.FAVICON,
                  OpenCms.getResourceManager().getResourceType(CmsResourceTypeImage.getStaticTypeName()));
          } catch (CmsVfsResourceAlreadyExistsException e) {
              //OK, Resource already there
              try {
                  favicon = m_cms.readResource(siteRoot + CmsSiteManager.FAVICON);
              } catch (CmsException e2) {
                  //no, it wasn't..
                  getReport().println(
                      Messages.get().container(Messages.RPT_SITE_ERROR_FAVICON_0),
                      I_CmsReport.FORMAT_ERROR);
                  getReport().println(e);
                  getReport().println(e2);
                  return;
              }
          } catch (CmsIllegalArgumentException | CmsException e) {
              getReport().println(Messages.get().container(Messages.RPT_SITE_ERROR_FAVICON_0), I_CmsReport.FORMAT_ERROR);
              getReport().println(e);
              return;
          }
          try {
              m_cms.lockResource(siteRoot + CmsSiteManager.FAVICON);
              CmsFile faviconFile = new CmsFile(favicon);
              faviconFile.setContents(m_os.toByteArray());
              m_cms.writeFile(faviconFile);
              m_cms.unlockResource(siteRoot + CmsSiteManager.FAVICON);
          } catch (CmsException e) {
              getReport().println(Messages.get().container(Messages.RPT_SITE_ERROR_FAVICON_0), I_CmsReport.FORMAT_ERROR);
              getReport().println(e);
              return;
          }
  
      }
docs: Saves outputstream of favicon as resource.<p>
  
  @param siteRoot site root of considered site.