Class 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 Detail

      • FilterAttachmentsScriptService

        public FilterAttachmentsScriptService()
    • Method Detail

      • 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 filter
        regexes - the list of regex patterns to match against attachment names
        Returns:
        a list of AttachmentReferences whose names match at least one regex