setAttribute

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

Sets 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, or the attribute value is of the correct type but has an inappropriate value.

ClassCastException - if the attribute value is not of the expected type

See Also

Files.setAttribute

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