Merge "Move extension checking code into FileUtils."