Refactor method getFileDirectory() in FileUtilities