fix: Defer path expansion until collect
in file scan methods
#17532
+167
−84
collect
in file scan methods
#17532