code: private boolean recursiveCheckSiblings(String path) throws CmsException {
  
          boolean result = false;
          CmsObject cms = getCms();
          /*
           * No trailing slash for the multi dialogs... therefore a read resource first necessary:
           */
          CmsResource resource = cms.readResource(path);
          path = cms.getSitePath(resource);
          if (CmsResource.isFolder(path)) {
              // only check subresources in case of recursive option checked.
              boolean undoRecursive = Boolean.valueOf(getParamRecursive()).booleanValue();
              if (undoRecursive) {
                  // don't read the whole tree, this is  expensive - most likely we will find a sibling faster step by step:
                  List<CmsResource> subResources = cms.readResources(path, CmsResourceFilter.ALL, false);
                  Iterator<CmsResource> itSubResources = subResources.iterator();
                  while (itSubResources.hasNext()) {
                      resource = itSubResources.next();
                      result = recursiveCheckSiblings(cms.getSitePath(resource));
                      if (result) {
                          break; // shortcut
                      }
                  }
              }
  
          } else {
              List<CmsResource> siblings = cms.readSiblings(path, CmsResourceFilter.ALL);
              result = siblings.size() > 1;
          }
          return result;
      }
docs: Depth first recursion for searching if a file has siblings with early termination.<p>
  
  This avoids to read a whole resource tree (which will be hard for e.g.  /sites/).<p>
  
  @param path the path to check the siblings in
  
  @return true if a resource which is a sibling was found.
  
  @throws CmsException if something goes wrong