Refactor #5580: Add new file&directory apis into FileUtils and test cases

Another one, please replace tab with 4 spaces.