code: private void checkParentFolders(CmsDbContext dbc, CmsPublishList publishList) throws CmsVfsException {
  
          boolean directPublish = publishList.isDirectPublish();
          // if we direct publish a file, check if all parent folders are already published
          if (directPublish) {
              // first get the names of all parent folders
              Iterator<CmsResource> it = publishList.getDirectPublishResources().iterator();
              List<String> parentFolderNames = new ArrayList<String>();
              while (it.hasNext()) {
                  CmsResource res = it.next();
                  String parentFolderName = CmsResource.getParentFolder(res.getRootPath());
                  if (parentFolderName != null) {
                      parentFolderNames.add(parentFolderName);
                  }
              }
              // remove duplicate parent folder names
              parentFolderNames = CmsFileUtil.removeRedundancies(parentFolderNames);
              String parentFolderName = null;
              try {
                  I_CmsVfsDriver vfsDriver = getVfsDriver(dbc);
                  // now check all folders if they exist in the online project
                  Iterator<String> parentIt = parentFolderNames.iterator();
                  while (parentIt.hasNext()) {
                      parentFolderName = parentIt.next();
                      vfsDriver.readFolder(dbc, CmsProject.ONLINE_PROJECT_ID, parentFolderName);
                  }
              } catch (CmsException e) {
                  throw new CmsVfsException(
                      Messages.get().container(Messages.RPT_PARENT_FOLDER_NOT_PUBLISHED_1, parentFolderName));
              }
          }
      }
docs: Checks that no one of the resources to be published has a 'new' parent (that has not been published yet).<p>
  
  @param dbc the db context
  @param publishList the publish list to check
  
  @throws CmsVfsException if there is a resource to be published with a 'new' parent