make FileUtils extendable
fix typo and memory leak
Merge pull request #9649 from minggo/fileutil-extend

make FileUtils extendable