code: protected void add(CmsResource resource, boolean check) throws IllegalArgumentException {
  
          if (check) {
              // it is essential that this method is only visible within the db package!
              if (resource.getState().isUnchanged()) {
                  throw new CmsIllegalArgumentException(
                      Messages.get().container(Messages.ERR_PUBLISH_UNCHANGED_RESOURCE_1, resource.getRootPath()));
              }
          }
          if (resource.isFolder()) {
              if (resource.getState().isDeleted()) {
                  if (!m_deletedFolderList.contains(resource)) {
                      // only add files not already contained in the list
                      m_deletedFolderList.add(resource);
                  }
              } else {
                  if (!m_folderList.contains(resource)) {
                      // only add files not already contained in the list
                      m_folderList.add(resource);
                  }
              }
          } else {
              if (!m_fileList.contains(resource)) {
                  // only add files not already contained in the list
                  // this is required to make sure no siblings are duplicated
                  m_fileList.add(resource);
              }
          }
      }
docs: Adds a new/changed Cms folder resource to the publish list.<p>
  
  @param resource a new/changed Cms folder resource
  @param check if set an exception is thrown if the specified resource is unchanged,
  if not set the resource is ignored
  
  @throws IllegalArgumentException if the specified resource is unchanged