Use for-loop instead of Java Stream API for concatenation of paths to reduce GC and CPU pressure. See #2992