Make pathFromFileURL a class method, so it can be overridden by
sub-classes.

Back-ported from 7.9
Merge branch 'public/7.7' into public/10.0