code: public CmsResource readDefaultFile(
          CmsRequestContext context,
          CmsResource resource,
          CmsResourceFilter resourceFilter)
      throws CmsSecurityException {
  
          CmsResource result = null;
          CmsDbContext dbc = m_dbContextFactory.getDbContext(context);
          try {
              CmsResource tempResult = m_driverManager.readDefaultFile(dbc, resource, resourceFilter);
              if (tempResult != null) {
                  // check if the user has read access to the resource
                  checkPermissions(dbc, tempResult, CmsPermissionSet.ACCESS_READ, true, resourceFilter);
                  result = tempResult;
              }
          } catch (CmsSecurityException se) {
              // permissions deny access to the resource
              throw se;
          } catch (CmsException e) {
              // ignore all other exceptions
              LOG.debug(e.getLocalizedMessage(), e);
          } finally {
              dbc.clear();
          }
          return result;
      }
docs: Returns the default file for the given folder.<p>
  
  If the given resource is a file, then this file is returned.<p>
  
  Otherwise, in case of a folder:<br>
  <ol>
  <li>the {@link CmsPropertyDefinition#PROPERTY_DEFAULT_FILE} is checked, and
  <li>if still no file could be found, the configured default files in the
  <code>opencms-vfs.xml</code> configuration are iterated until a match is
  found, and
  <li>if still no file could be found, <code>null</code> is returned
  </ol><p>
  
  @param context the request context
  @param resource the folder to get the default file for
  @param resourceFilter the resource filter
  
  @return the default file for the given folder
  
  @throws CmsSecurityException if the user has no permissions to read the resulting file
  
  @see CmsObject#readDefaultFile(String)