code: protected CmsResource internalCreateResourceForOrgUnit(CmsDbContext dbc, String path, int flags)
      throws CmsException {
  
          // create the offline folder
          CmsResource resource = new CmsFolder(
              new CmsUUID(),
              new CmsUUID(),
              path,
              CmsResourceTypeFolder.RESOURCE_TYPE_ID,
              (CmsResource.FLAG_INTERNAL | flags),
              dbc.currentProject().getUuid(),
              CmsResource.STATE_NEW,
              0,
              dbc.currentUser().getId(),
              0,
              dbc.currentUser().getId(),
              CmsResource.DATE_RELEASED_DEFAULT,
              CmsResource.DATE_EXPIRED_DEFAULT,
              0);
  
          CmsUUID projectId = ((dbc.getProjectId() == null) || dbc.getProjectId().isNullUUID())
          ? dbc.currentProject().getUuid()
          : dbc.getProjectId();
  
          m_driverManager.getVfsDriver(dbc).createResource(dbc, projectId, resource, null);
          resource.setState(CmsResource.STATE_UNCHANGED);
          m_driverManager.getVfsDriver(dbc).writeResource(dbc, projectId, resource, CmsDriverManager.NOTHING_CHANGED);
  
          if (!dbc.currentProject().isOnlineProject() && dbc.getProjectId().isNullUUID()) {
              // online persistence
              CmsProject onlineProject = m_driverManager.readProject(dbc, CmsProject.ONLINE_PROJECT_ID);
              m_driverManager.getVfsDriver(dbc).createResource(dbc, onlineProject.getUuid(), resource, null);
          }
  
          // clear the internal caches
          OpenCms.getMemoryMonitor().clearAccessControlListCache();
          OpenCms.getMemoryMonitor().flushCache(CmsMemoryMonitor.CacheType.PROPERTY);
          OpenCms.getMemoryMonitor().flushCache(CmsMemoryMonitor.CacheType.PROPERTY_LIST);
  
          // fire an event that a new resource has been created
          OpenCms.fireCmsEvent(
              new CmsEvent(
                  I_CmsEventListener.EVENT_RESOURCE_CREATED,
                  Collections.<String, Object> singletonMap(I_CmsEventListener.KEY_RESOURCE, resource)));
  
          return resource;
      }
docs: Creates a folder with the given path an properties, offline AND online.<p>
  
  @param dbc the current database context
  @param path the path to create the folder
  @param flags the resource flags
  
  @return the new created offline folder
  
  @throws CmsException if something goes wrong