code: protected boolean resourceIsValid(CmsResource resource) {
  
          if (!resource.getRootPath().startsWith(m_basePath)) {
              return false;
          }
          if (m_requireFile & resource.isFolder()) {
              return false;
          }
          if (m_requireFolder & resource.isFile()) {
              return false;
          }
          return true;
      }
docs: Checks if the given resource is valid according to require Folder or File.<p>
  
  @param resource to check
  @return true if resource is valid