Filter link parameters from a provided Link object, if configured to do so.
@param link the link
@param filter whether to filter the memento parameters
@return a Link without Memento parameters, if desired; otherwise, the original link
485118
public static Link filterLinkParams(final Link link, final boolean filter) {
        // from and until parameters can cause problems with downstream applications because they contain commas. This
        // method makes it possible to filter out those params, if desired. By default, they are not filtered out.
        if (filter) {
            if (TIMEMAP.equals(link.getRel())) {
                return Link.fromUri(link.getUri()).rel(TIMEMAP).type(APPLICATION_LINK_FORMAT).build();
            } else if (MEMENTO.equals(link.getRel())) {
                return Link.fromUri(link.getUri()).rel(MEMENTO).build();
            }
        }
        return link;
    }
576348
@Override
    public Map<ArchivePath, Node> getContent(Filter<ArchivePath> filter) {
        Validate.notNull(filter, "Filter must be specified");

        Map<ArchivePath, Node> filteredContent = new LinkedHashMap<ArchivePath, Node>();
        for (Map.Entry<ArchivePath, NodeImpl> contentEntry : content.entrySet()) {
            if (filter.include(contentEntry.getKey())) {
                if (!contentEntry.getKey().equals(new BasicPath("/"))) {
                    filteredContent.put(contentEntry.getKey(), contentEntry.getValue());
                }
            }
        }
        return filteredContent;
    }
334031
public static String addToFilter(String filter, String key, String value)
    {
        if (value != null) 
        {
            String newFilter = "(" + key + "=" + value + ")";
            if ((filter == null) || (filter.length() == 0))
                filter = newFilter;
            else if ((filter.startsWith("(&")) && (filter.endsWith("")))
                filter = filter.substring(0, filter.length() - 1) + newFilter + ")";
            else
                filter = "(&" + filter + newFilter + ")";
        }
        return filter;
    }
811113
public T filter(@NonNull SerializablePredicate<? super HString> filter) {
      this.filter = filter;
      return Cast.as(this);
   }
1365755
public final LinkHandler getLink(String linkName)
    {
        LinkTypeFilter filter = new LinkTypeFilter();
        return (LinkHandler) linkIndex.findByName(linkName, filter);
    }
470222
public void setFilter(String filter) {
		if(filter == null || filter.length() == 0 ) {
			this.filter = null;
		} else {
			this.filter = filter;
		}
		
		// Reload the list of files.
		this.loadFolder(this.currentFolder);
	}
216468
@Bind(aggregate = true, optional = true)
    public void bindFilter(Filter filter) {
        filters.add(filter);
    }
557773
public void set_filter(filtervalue[] filter) 
	{
		String str = null;
		for (int i = 0; i < filter.length; i++)
		{
			if (str != null)
				str = str + ",";
			if (str == null)
				str = filter[i].get_name() + ":" + nitro_util.encode(filter[i].get_value());
			else
				str = str + filter[i].get_name() + ":" + nitro_util.encode(filter[i].get_value());;
		}
		this.filter = str;
	}
591587
public static List<Path> getSubDirectoryPathList(Path startDirectoryPath,
			Predicate<Path> filter) {
		return getSubPathList(startDirectoryPath, Integer.MAX_VALUE,
				DirectoryAndNotSymbolicLinkFilter.and(filter));
	}
984084
private String detokenizeURLs(String line) {
    final Matcher linkMatcher = wrongLink.matcher(line);
    final StringBuffer sb = new StringBuffer();
    while (linkMatcher.find()) {
      linkMatcher.appendReplacement(sb,
          linkMatcher.group().replaceAll("\\s", ""));
    }
    linkMatcher.appendTail(sb);
    line = sb.toString();
    return line;
  }
918963
public static boolean linkFrom(String basePath) {
        if (Objects.equals(basePath, LINK_FROM.get())) return false;
        if (basePath == null) LINK_FROM.remove();
        else LINK_FROM.set(basePath);
        return true;
    }
925804
public CmsLogFilter filterResource(CmsUUID structureId) {

        CmsLogFilter filter = (CmsLogFilter)clone();
        filter.m_structureId = structureId;
        return filter;
    }
303504
@Override
    public Promise<Void> unlink(String link) {
        return adapter.toPromise(handler -> vertx.fileSystem().unlink(link, handler));
    }
1197485
public void addLink(String linkName, Link link) {
		if (links == null) {
			links = new Links(new HashMap<String, Link>());
		}
		links.addLink(linkName, link);
	}
460357
public final boolean lockIfMatches(final Filter filter, long lockID) throws SevereMessageStoreException
    {
        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
            SibTr.entry(this, tc, "lockIfMatches", new Object[] { filter, Long.valueOf(lockID) });

        boolean locked = false;

        boolean matches = false;
        AbstractItem item = getItem();
        if (null == item)
        {
            if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
                SibTr.debug(this, tc, "item does not exist");
        }
        else
        {
            try
            {
                if (null == filter || filter.filterMatches(item))
                {
                    matches = true;
                }
            } catch (Exception e)
            {
                //No FFDC Code Needed.
                // assume exception is false return
            }
        }

        boolean hasBecomeNonReleasable = false;
        if (matches)
        {
            synchronized (this)
            {
                if (isAvailable() && !isExpired())
                {
                    if (ItemLinkState.STATE_AVAILABLE == _itemLinkState)
                    {
                        ListStatistics stats = getParentStatistics();
                        synchronized (stats)
                        {
                            stats.incrementLocked();
                            stats.decrementAvailable();
                        }
                    }
                    else
                    {
                        if (TraceComponent.isAnyTracingEnabled() && tc.isEventEnabled())
                            SibTr.event(this, tc, "Invalid Item state: " + _itemLinkState);
                        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
                            SibTr.exit(this, tc, "lockIfMatches");
                        throw new StateException(_itemLinkState.toString());
                    }

                    _lockID = lockID;
                    hasBecomeNonReleasable = _declareNotDiscardable(item);
                    _itemLinkState = ItemLinkState.STATE_LOCKED;
                    locked = true;
                }
            }
            if (hasBecomeNonReleasable)
            {
                _declareNotReleasable();
            }
        }

        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
            SibTr.exit(this, tc, "lockIfMatches", Boolean.valueOf(locked));
        return locked;
    }
269617
public static NodeSet fromFilter(String filter) {
        Map<String, Map<String, String>> stringMapMap = parseFilter(filter);
        NodeSet nodeSet = new NodeSet();
        nodeSet.createInclude(stringMapMap.get("include"));
        nodeSet.createExclude(stringMapMap.get("exclude"));
        return nodeSet;
    }
1030456
public void setDependencyFilter(ObjectNode filter) {
        if (filter == null) {
            return;
        }
        final JsonNode patterns = filter.get("patterns");
        if (patterns != null && patterns.isArray()) {
            List<String> ids = new ArrayList<>();
            for (JsonNode exclusion : patterns) {
                ids.add(exclusion.asText());
            }
            setDependencyFilter(new ExcludesArtifactFilter(ids));
        }
    }