code: public void readDependencies(CmsObject cms) {
  
          try {
              // read all resources in the parent folder of the published resource
              List<CmsResource> folderContent = cms.getResourcesInFolder(
                  CmsResource.getParentFolder(cms.getRequestContext().removeSiteRoot(getResource().getRootPath())),
                  CmsResourceFilter.DEFAULT);
              // now calculate the dependencies form the folder content that has been read
              readDependencies(cms, folderContent);
          } catch (CmsException e) {
              LOG.warn("Unable to read dependencies for " + getResource().getRootPath(), e);
          }
      }
docs: Reads all dependencies that exist for this main resource in the OpenCms VFS.<p>
  
  To be used when incremental updating an index.<p>
  
  @param cms the current users OpenCms context