[ https://issues.apache.org/jira/browse/SLING-5837?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15378195#comment-15378195 ]
Stefan Seifert commented on SLING-5837: --------------------------------------- i've no opinion whether {{java.nio.file.PathMatcher}} may be platform-depenent or not - but i've some other remarks: # why are we using glob matching at all? i cannot remember we support this anywhere else in sling - in other areas we just use regular expression matching, which is more powerful. e.g. in sling mapping. why support here glob and only glob? # checking if the path contains "?" or "*" is not enough to detect a glob. according to https://docs.oracle.com/javase/tutorial/essential/io/fileOps.html#glob it can contain other special chars as well e.g. square brackets. # parsing and instantiating a new PathMatcher on every "matches" method invocation feels very inperformant. what if with this path instance server thousands paths are checked. for regex it is common to precompile the regex and reuse the Pattern instances. > Allow ResourceChangeListeners to define glob patterns for resource matching > --------------------------------------------------------------------------- > > Key: SLING-5837 > URL: https://issues.apache.org/jira/browse/SLING-5837 > Project: Sling > Issue Type: Improvement > Components: API > Affects Versions: API 2.12.0 > Reporter: Radu Cotescu > Assignee: Radu Cotescu > Fix For: API 2.13.0 > > Attachments: SLING-5837.patch > > > While the previous way to interact with Resource change events through > registering {{EventHandler}} sevices allowed defining glob patterns for > matching the watched paths, the current state of the > {{org.apache.sling.api.resource.observation.ResourceChangeListener}} only > allows subscribing to events for concrete paths. > In order to allow for the same filtering flexibility, > {{ResourceChangeListener}} should also accept glob patterns for its > {{resource.paths}} configuration property. -- This message was sent by Atlassian JIRA (v6.3.4#6332)