suggest java.nio.Files.walkFileTree as replacement for DirectoryScanner by elharo · Pull Request #133 · apache/maven-shared-utils (original) (raw)
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking at those I don't see both as a 1:1 alternative, no? It still requires addon code.
That is correct. It's not a 1:1 replacement, but it does serve the same purpose. Starting from a green field it's no more work to write new code on top of Files.walkFileTree or DirectoryStream instead of DirectoryScanner; and those are more familiar since they're in the JDK. However, migrating from existing DirectoryScanner to one of the JDK alternatives is not a simple search and replace. I'm working on some of those migrations now which is where I noticed Files.walkFileTree was also a good option.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please mention the missing bits in your deprecation notice.
Are there missing bits you're especially concerned about like the default exclusions? Nothing is really missing from the alternatives. It's just that you have to write different code, sort of like the difference between going from 14th Street to Penn Station via subway or taxi. Both have the same endpoints but the route and procedure are quite different.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
[ Show hidden characters]({{ revealButtonHref }})