[
https://issues.apache.org/jira/browse/SLING-6161?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15582662#comment-15582662
]
Carsten Ziegeler commented on SLING-6161:
-----------------------------------------
I've enhanced the implementation, javadocs and test cases in rev 1765329.
The provided argument to the constructor needs to contain an absolute path or
pattern starting with a slash, otherwise IllegalArgumentException will be
thrown.
If the Path object is a path and matches is called with a path, it checks
whether the provided path is the same or a sub path.
If the Path object is a path and matches is called with a pattern, it checks
whether the provided pattern is handled by the Path, so the path is either a
parent or is matches a prefix part of the pattern
If the Path object is a pattern and matches is called with a path, it checks
whether the path matches the pattern
if the Path object is a pattern and matches is called with a pattern, it checks
if both patterns are the same
> Correctly implement Path.matches
> --------------------------------
>
> Key: SLING-6161
> URL: https://issues.apache.org/jira/browse/SLING-6161
> Project: Sling
> Issue Type: Task
> Components: API
> Affects Versions: API 2.14.2
> Reporter: Carsten Ziegeler
> Assignee: Carsten Ziegeler
> Priority: Blocker
> Fix For: API 2.15.0
>
>
> With SLING-5909 a new behaviour has been introduced to Path.matches() which
> supports matches a Path against a glob pattern.
> The attached test only convers a Path object with "/", but it is unclear what
> the intend of this change actually is - and what the semantics is.
> The javadoc of matches() right now clearly states that the argument should be
> a path, therefore glob pattern is not supported in that method.
> [~radu.cotescu] Could you please comment on the intended behaviour?
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)