code: protected void deleteResource(CmsDbContext dbc, CmsResource resource, CmsResource.CmsResourceDeleteMode siblingMode)
      throws CmsException {
  
          if (resource.isFolder()) {
              // collect all resources in the folder (but exclude deleted ones)
              List<CmsResource> resources = m_driverManager.readChildResources(
                  dbc,
                  resource,
                  CmsResourceFilter.IGNORE_EXPIRATION,
                  true,
                  true,
                  false);
  
              Set<CmsUUID> deletedResources = new HashSet<CmsUUID>();
              // now walk through all sub-resources in the folder
              for (int i = 0; i < resources.size(); i++) {
                  CmsResource childResource = resources.get(i);
                  if ((siblingMode == CmsResource.DELETE_REMOVE_SIBLINGS)
                      && deletedResources.contains(childResource.getResourceId())) {
                      // sibling mode is "delete all siblings" and another sibling of the current child resource has already
                      // been deleted- do nothing and continue with the next child resource.
                      continue;
                  }
                  if (childResource.isFolder()) {
                      // recurse into this method for subfolders
                      deleteResource(dbc, childResource, siblingMode);
                  } else {
                      // handle child resources
                      m_driverManager.deleteResource(dbc, childResource, siblingMode);
                  }
                  deletedResources.add(childResource.getResourceId());
              }
              deletedResources.clear();
          }
          // handle the resource itself
          m_driverManager.deleteResource(dbc, resource, siblingMode);
      }
docs: Internal recursive method for deleting a resource.<p>
  
  @param dbc the db context
  @param resource the name of the resource to delete (full path)
  @param siblingMode indicates how to handle siblings of the deleted resource
  
  @throws CmsException if something goes wrong