docs: public CmsFile writeFile(CmsRequestContext context, CmsFile resource) throws CmsException, CmsSecurityException {
  
          CmsDbContext dbc = m_dbContextFactory.getDbContext(context);
          CmsFile result = null;
          try {
              checkOfflineProject(dbc);
              checkPermissions(dbc, resource, CmsPermissionSet.ACCESS_WRITE, true, CmsResourceFilter.ALL);
              result = m_driverManager.writeFile(dbc, resource);
          } catch (Exception e) {
              dbc.report(null, Messages.get().container(Messages.ERR_WRITE_FILE_1, context.getSitePath(resource)), e);
          } finally {
              dbc.clear();
          }
          return result;
      }