Extensions for kotlin.collections.List

normalizePathComponents

fun List<String>.normalizePathComponents(): List<String>

Process path components such as . and .., replacing redundant path components including all leading. It also discards all reserved characters and component names that are reserved (such as CON, NUL).