code: private boolean isDefaultFile(CmsResource resource) throws CmsException {
  
          CmsObject cms = getCmsObject();
          if (resource.isFolder()) {
              return false;
          }
  
          CmsResource parent = cms.readResource(
              CmsResource.getParentFolder(cms.getSitePath(resource)),
              CmsResourceFilter.ONLY_VISIBLE_NO_DELETED);
          CmsResource defaultFile = cms.readDefaultFile(parent, CmsResourceFilter.ONLY_VISIBLE_NO_DELETED);
          return resource.equals(defaultFile);
      }
docs: Checks whether a resource is a default file of a folder.<p>
  
  @param resource the resource to check
  
  @return true if the resource is the default file of a folder
  
  @throws CmsException if something goes wrong