As of 23.3, com.google.common.collect.TreeTraverser is deprecated. Are Files.fileTreeTraverser() and MoreFiles.directoryTreeTraverser() deprecated too? Should users migrate to java.nio.file.SimpleFileVisitor?
Note that MoreFiles.directoryTreeTraverser() appeared in 21.0 (Java 8), despite SimpleFileVisitor presence (Java 7).
The immediate intent of deprecatingcommon.collect.TreeTraverser is to discourage new uses of it in favor of common.graph.Traverser.
The Files and MoreFiles methods are not deprecated at this time, and I don't know what the plans are for them. Options include (a) removing them outright, and (b) replacing them with methods that use Traverser; we probably won't just leave them alone indefinitely.
My understanding was that there won鈥檛 be any breaking changes after 22.0. So option (a) is actually not an option, is it?
@szarnekow I thought that too, but then I remembered that the Guava team also announced that @Beta stuff will still be eligible for consideration of removal. Given that TreeTraverser's still in @Beta, option (a) is still a valid option AFAICT.
Files and MoreFiles are also each @Beta.
We're adding Files.fileTraverser() and MoreFiles.fileTraverser() as graph.Traverser versions of the TreeTraverser-returning methods and will be deprecating those methods. That should be in this week's release.
Most helpful comment
We're adding
Files.fileTraverser()andMoreFiles.fileTraverser()asgraph.Traverserversions of theTreeTraverser-returning methods and will be deprecating those methods. That should be in this week's release.