How can I get the contents of a `Path` sorted such...
# getting-started
z
How can I get the contents of a
Path
sorted such that files/folders prefixed with a
.
are first, then alphabetically, and also so all folders come before files? I'm not really familiar with the sorting methods available to collections.
e
Copy code
path.listDirectoryEntries().sortedWith(
    compareByDescending(Path::isDirectory)
        .thenByDescending {
            it.fileName.toString().startsWith(".")
        }
        .then(naturalOrder())
    )
)
👌 1