getAttribute

Platform and version requirements: JVM (1.5), JRE7 (1.5)
fun Path.getAttribute(
    attribute: String, 
    vararg options: LinkOption
): Any?

Reads the value of a file attribute.

The attribute name is specified with the attribute parameter optionally prefixed with the attribute view name:

[view_name:]attribute_name

When the view name is not specified, it defaults to basic.

Exceptions

UnsupportedOperationException - if the attribute view is not supported.

IllegalArgumentException - if the attribute name is not specified or is not recognized.

See Also

Files.getAttribute

© 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/get-attribute.html