code: public CmsFolder readAncestor(String resourcename, CmsResourceFilter filter) throws CmsException {
  
          CmsResource resource = readResource(resourcename, CmsResourceFilter.ALL);
          return m_securityManager.readAncestor(m_context, resource, filter);
      }
docs: Returns the first ancestor folder matching the filter criteria.<p>
  
  If no folder matching the filter criteria is found, null is returned.<p>
  
  @param resourcename the name of the resource to start (full current site relative path)
  @param filter the resource filter to match while reading the ancestors
  
  @return the first ancestor folder matching the filter criteria or null if no folder was found
  
  @throws CmsException if something goes wrong