readAttributes
fun <reified A : BasicFileAttributes> Path.readAttributes( vararg options: LinkOption ): A
Reads a file's attributes of the specified type A in bulk.
Parameters
A
- the reified type of the desired attributes, a subtype of BasicFileAttributes.
Exceptions
UnsupportedOperationException
- if the given attributes type A is not supported.
See Also
fun Path.readAttributes( attributes: String, vararg options: LinkOption ): Map<String, Any?>
Reads the specified list of attributes of a file in bulk.
The list of attributes to read is specified in the following string form:
[view:]attribute_name1[,attribute_name2...]
So the names are comma-separated and optionally prefixed by the attribute view type name, basic
by default. The special *
attribute name can be used to read all attributes of the specified view.
Exceptions
UnsupportedOperationException
- if the attribute view is not supported.
IllegalArgumentException
- if no attributes are specified or an unrecognized attribute is specified.
Return a Map having an entry for an each attribute read, where the key is the attribute name and the value is the attribute value.
See Also
© 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/read-attributes.html