Returns an extended filter that requires all returned resources to be folders.<p>

@return an extended filter that requires all returned resources to be folders
504488
public CmsResourceFilter addRequireFolder() {

        CmsResourceFilter extendedFilter = (CmsResourceFilter)clone();

        extendedFilter.m_onlyFolders = Boolean.TRUE;
        extendedFilter.updateCacheId();

        return extendedFilter;
    }
970281
public CmsResourceFilter addRequireExpireBefore(long time) {

        CmsResourceFilter extendedFilter = (CmsResourceFilter)clone();

        extendedFilter.m_filterExpire = true;
        extendedFilter.m_expireBefore = time;
        extendedFilter.updateCacheId();

        return extendedFilter;
    }
852989
protected List<CmsResource> getResources() {

        List<CmsResource> result = Collections.emptyList();
        // get all image resources of the folder
        CmsResourceFilter filter = CmsResourceFilter.DEFAULT;
        try {
            CmsObject cms = getCms();
            result = cms.readResources(getParamResource(), filter, false);

        } catch (CmsException e) {
            // log, should never happen
            if (LOG.isErrorEnabled()) {
                LOG.error(e.getLocalizedMessage(getLocale()));
            }
        }
        return result;
    }
915108
public FolderResources folderResources() {
        if (folders.get() == null) {
            folders.compareAndSet(null, new FolderResourcesImpl(this));
        }
        return folders.get();
    }
939060
public CmsRelationFilter filterStrong() {

        CmsRelationFilter filter = (CmsRelationFilter)clone();
        if (filter.m_types.isEmpty()) {
            filter.m_types.addAll(CmsRelationType.getAllStrong());
        } else {
            filter.m_types = new HashSet<CmsRelationType>(CmsRelationType.filterStrong(filter.m_types));
        }
        return filter;
    }
1192372
public CmsSolrQuery getQuery(CmsObject cms) {

        final CmsSolrQuery query = new CmsSolrQuery();

        // set categories
        query.setCategories(m_categories);

        // set container types
        if (null != m_containerTypes) {
            query.addFilterQuery(CmsSearchField.FIELD_CONTAINER_TYPES, m_containerTypes, false, false);
        }

        // Set date created time filter
        query.addFilterQuery(
            CmsSearchUtil.getDateCreatedTimeRangeFilterQuery(
                CmsSearchField.FIELD_DATE_CREATED,
                getDateCreatedRange().m_startTime,
                getDateCreatedRange().m_endTime));

        // Set date last modified time filter
        query.addFilterQuery(
            CmsSearchUtil.getDateCreatedTimeRangeFilterQuery(
                CmsSearchField.FIELD_DATE_LASTMODIFIED,
                getDateLastModifiedRange().m_startTime,
                getDateLastModifiedRange().m_endTime));

        // set scope / folders to search in
        m_foldersToSearchIn = new ArrayList<String>();
        addFoldersToSearchIn(m_folders);
        addFoldersToSearchIn(m_galleries);
        setSearchFolders(cms);
        query.addFilterQuery(
            CmsSearchField.FIELD_PARENT_FOLDERS,
            new ArrayList<String>(m_foldersToSearchIn),
            false,
            true);

        if (!m_ignoreSearchExclude) {
            // Reference for the values: CmsGallerySearchIndex.java, field EXCLUDE_PROPERTY_VALUES
            query.addFilterQuery(
                "-" + CmsSearchField.FIELD_SEARCH_EXCLUDE,
                Arrays.asList(
                    new String[] {
                        A_CmsSearchIndex.PROPERTY_SEARCH_EXCLUDE_VALUE_ALL,
                        A_CmsSearchIndex.PROPERTY_SEARCH_EXCLUDE_VALUE_GALLERY}),
                false,
                true);
        }

        // set matches per page
        query.setRows(new Integer(m_matchesPerPage));

        // set resource types
        if (null != m_resourceTypes) {
            List<String> resourceTypes = new ArrayList<>(m_resourceTypes);
            if (m_resourceTypes.contains(CmsResourceTypeFunctionConfig.TYPE_NAME)
                && !m_resourceTypes.contains(CmsXmlDynamicFunctionHandler.TYPE_FUNCTION)) {
                resourceTypes.add(CmsXmlDynamicFunctionHandler.TYPE_FUNCTION);
            }
            query.setResourceTypes(resourceTypes);
        }

        // set result page
        query.setStart(new Integer((m_resultPage - 1) * m_matchesPerPage));

        // set search locale
        if (null != m_locale) {
            query.setLocales(CmsLocaleManager.getLocale(m_locale));
        }

        // set search words
        if (null != m_words) {
            query.setQuery(m_words);
        }

        // set sort order
        query.setSort(getSort().getFirst(), getSort().getSecond());

        // set result collapsing by id
        query.addFilterQuery("{!collapse field=id}");

        query.setFields(CmsGallerySearchResult.getRequiredSolrFields());

        if ((m_allowedFunctions != null) && !m_allowedFunctions.isEmpty()) {
            String functionFilter = "((-type:("
                + CmsXmlDynamicFunctionHandler.TYPE_FUNCTION
                + " OR "
                + CmsResourceTypeFunctionConfig.TYPE_NAME
                + ")) OR (id:(";
            Iterator<CmsUUID> it = m_allowedFunctions.iterator();
            while (it.hasNext()) {
                CmsUUID id = it.next();
                functionFilter += id.toString();
                if (it.hasNext()) {
                    functionFilter += " OR ";
                }
            }
            functionFilter += ")))";
            query.addFilterQuery(functionFilter);
        }

        return query;
    }
535601
private HashSet<Resource> getResources(GeneratorContext context, JClassType userType, FileFilter filter) {
    final String pack = userType.getPackage().getName().replace('.', '/');

    HashSet<Resource> resourceList = new HashSet<Resource>();
    for (String path : context.getResourcesOracle().getPathNames()) {
      if (!path.startsWith(pack))
        continue;
      String ext = getExtension(path);
      if (EXTENSION_MAP.containsKey(ext))
        resourceList.add(context.getResourcesOracle().getResource(path));
    }

    return resourceList;
  }
1133169
public CmsResourceFilter addRequireReleaseBefore(long time) {

        CmsResourceFilter extendedFilter = (CmsResourceFilter)clone();

        extendedFilter.m_filterRelease = true;
        extendedFilter.m_releaseBefore = time;
        extendedFilter.updateCacheId();

        return extendedFilter;
    }
1089044
private void storeFolderFilter(Set<String> folders) {

        JSONObject storedFilters = readUserFolderFilters();
        try {
            storedFilters.put(getCmsObject().getRequestContext().getSiteRoot(), folders);
            CmsUser user = getCmsObject().getRequestContext().getCurrentUser();
            user.setAdditionalInfo(FOLDER_FILTER_ADD_INFO_KEY, storedFilters.toString());
            getCmsObject().writeUser(user);
        } catch (Exception e) {
            LOG.error(e.getLocalizedMessage(), e);
        }
    }
826570
private List<CmsResource> getResources() {

        List<CmsResource> result = new LinkedList<CmsResource>();
        CmsObject cms = getCms();
        CmsResourceFilter filter = CmsResourceFilter.ALL;
        try {
            for (String path : m_paths) {
                List<CmsResource> resources = cms.readResources(path, filter, true);
                // filter out any resource that is no XML content:
                for (CmsResource resource : resources) {
                    if (resource.isFile()) {
                        if (CmsResourceTypeXmlContent.isXmlContent(resource)) {
                            result.add(resource);
                        } else if (CmsResourceTypeXmlPage.isXmlPage(resource)) {
                            result.add(resource);
                        }
                    }
                }
            }
        } catch (CmsException e) {
            LOG.error(Messages.get().getBundle().key(Messages.LOG_ERR_LANGUAGECOPY_READRESOURCES_0), e);
            result = Collections.emptyList();
        }

        return result;
    }
288900
protected ResourceFilter buildTreeFilter(ResourceFilter configuredFilter) {
        return new ResourceFilter.FilterSet(
                ResourceFilter.FilterSet.Rule.tree, // a tree filter including intermediate folders
                new ResourceFilter.FilterSet(ResourceFilter.FilterSet.Rule.and,
                        // the combination with the default mapping filter excludes 'rep:...' nodes
                        configuredFilter,
                        nodesConfig.getDefaultNodeFilter()),
                nodesConfig.getTreeIntermediateFilter());
    }
1256204
public List<FilterMappingType<WebFragmentDescriptor>> getAllFilterMapping()
   {
      List<FilterMappingType<WebFragmentDescriptor>> list = new ArrayList<FilterMappingType<WebFragmentDescriptor>>();
      List<Node> nodeList = model.get("filter-mapping");
      for(Node node: nodeList)
      {
         FilterMappingType<WebFragmentDescriptor>  type = new FilterMappingTypeImpl<WebFragmentDescriptor>(this, "filter-mapping", model, node);
         list.add(type);
      }
      return list;
   }
477321
public CmsLockFilter filterIncludeChildren() {

        CmsLockFilter filter = (CmsLockFilter)clone();
        filter.m_includeChildren = true;
        return filter;
    }
751372
public List<FilterType<PortletAppType<T>>> getAllFilter()
   {
      List<FilterType<PortletAppType<T>>> list = new ArrayList<FilterType<PortletAppType<T>>>();
      List<Node> nodeList = childNode.get("filter");
      for(Node node: nodeList)
      {
         FilterType<PortletAppType<T>>  type = new FilterTypeImpl<PortletAppType<T>>(this, "filter", childNode, node);
         list.add(type);
      }
      return list;
   }
955002
public CmsResourceFilter addExcludeFlags(int flags) {

        CmsResourceFilter extendedFilter = (CmsResourceFilter)clone();

        extendedFilter.m_flags = flags;
        extendedFilter.m_filterFlags = EXCLUDED;
        extendedFilter.updateCacheId();

        return extendedFilter;
    }
486357
@SuppressWarnings("unchecked")
    public Collection<String> listFolders(File folder) {
        IOFileFilter ioFileFilter = FileFilterUtils.makeSVNAware(FileFilterUtils.makeCVSAware(FileFilterUtils.trueFileFilter()));
        Collection<File> files = FileUtils.listFiles(folder, FileFilterUtils.fileFileFilter(), ioFileFilter);
        Set<String> ret = newTreeSet();
        for (File file : files) {
            ret.add(file.getParentFile().getAbsolutePath());
        }
        return ret;
    }
458174
public static FileFilter getFileFilter() {
        return new FileFilter() {

            @Override
            public boolean accept(File pathname) {
                //Accept if input  is a non-hidden file with registered extension
                //or if a non-hidden and not-ignored directory
                return !pathname.isHidden() && (pathname.isFile()
                    && Engines.getRecognizedExtensions().contains(fileExt(pathname))) || (directoryOnlyIfNotIgnored(pathname));
            }
        };
    }