Package com.xwiki.macros.confluence
Class FilterAttachmentsScriptService
java.lang.Object
com.xwiki.macros.confluence.FilterAttachmentsScriptService
- All Implemented Interfaces:
org.xwiki.script.service.ScriptService
@Component
@Singleton
@Named("filterAttachments")
@Unstable
public class FilterAttachmentsScriptService
extends Object
implements org.xwiki.script.service.ScriptService
Script service for filtering attachments using regex expressions.
- Since:
- 1.26.18
- Version:
- $Id$
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionList<org.xwiki.model.reference.AttachmentReference>filterAttachmentResults(List<org.xwiki.model.reference.AttachmentReference> attachments, List<String> regexes) Filters a list of AttachmentReferences by checking if their names match any of the given regex patterns.
-
Constructor Details
-
FilterAttachmentsScriptService
public FilterAttachmentsScriptService()
-
-
Method Details
-
filterAttachmentResults
public List<org.xwiki.model.reference.AttachmentReference> filterAttachmentResults(List<org.xwiki.model.reference.AttachmentReference> attachments, List<String> regexes) Filters a list of AttachmentReferences by checking if their names match any of the given regex patterns.- Parameters:
attachments- the list of AttachmentReference objects to filterregexes- the list of regex patterns to match against attachment names- Returns:
- a list of AttachmentReferences whose names match at least one regex
-