Compile fix on FileUtils::getDirectory().

This commit fixes the compiler error in FileUtills::getDirectory() when building FileUtills.cpp.

This commit also corrects some code formatting issues in
FileUtills::getDirectory() as well.