function _sortDirectoryContents(contents, dirsFirst) {
        if (dirsFirst) {
            return contents.keySeq().sort(_buildDirsFirstComparator(contents));
        } else {
            return contents.keySeq().sort(FileUtils.compareFilenames);
        }
    }
@private

Sort a directory either alphabetically or with subdirectories listed first.

@param {Immutable.Map} contents the directory's contents
@param {boolean} dirsFirst true to sort subdirectories first
@return {Immutable.Map} sorted mapping