You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "Michael Osipov (Jira)" <ji...@apache.org> on 2021/05/03 18:11:00 UTC
[jira] [Commented] (MSHARED-989) Undeprecate DirectoryScanner and
MatchPattern(s)
[ https://issues.apache.org/jira/browse/MSHARED-989?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17338538#comment-17338538 ]
Michael Osipov commented on MSHARED-989:
----------------------------------------
I think {{DirectoryScanner}} should be a thin wrapper around NIO2 providing everything NIO2 does not provide out of the box.
> Undeprecate DirectoryScanner and MatchPattern(s)
> ------------------------------------------------
>
> Key: MSHARED-989
> URL: https://issues.apache.org/jira/browse/MSHARED-989
> Project: Maven Shared Components
> Issue Type: Improvement
> Components: maven-shared-utils
> Reporter: Konrad Windszus
> Priority: Major
>
> In MSHARED-898 {{DirectoryScanner}} has been deprecated. Instead using the {{java.nio.file.DirectoryStream}} is now recommended.
> The latter is often no replacement as the parametrization of DirectoryScanner with Ant-style globs for includes/excludes is not supported. Also the {{DEFAULTEXCLUDES}} are not part of Java NIO {{DirectoryStream}} either.
> The same applies to {{MatchPatterns}}, which is deprecated and now recommends using {{java.nio.filejava.nio.file.DirectoryStream.Filter<T>}}. Please instead provide a Filter for Java NIO for those patterns (regex and ant) and make {{DirectoryScanner}} use File NIO internally while keeping API compatibility.
> Otherwise every consumer of DirectoryScanner needs to come up with a custom implementation of pattern matching and a lot of glue code.
--
This message was sent by Atlassian Jira
(v8.3.4#803005)