useDirectoryEntries

Platform and version requirements: JVM (1.5), JRE7 (1.5)
inline fun <T> Path.useDirectoryEntries(
    glob: String = "*", 
    block: (Sequence<Path>) -> T
): T

Calls the block callback with a sequence of all entries in this directory optionally filtered by matching against the specified glob pattern.

Parameters

glob - the globbing pattern. The syntax is specified by the FileSystem.getPathMatcher method.

Exceptions

java.util.regex.PatternSyntaxException - if the glob pattern is invalid.

NotDirectoryException - If this path does not refer to a directory.

IOException - If an I/O error occurs.

Return the value returned by block.

See Also

Files.newDirectoryStream

© 2010–2021 JetBrains s.r.o. and Kotlin Programming Language contributors
Licensed under the Apache License, Version 2.0.
https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.io.path/java.nio.file.-path/use-directory-entries.html