readAttributes

JVM
JRE7
1.4
@ExperimentalPathApi 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

Files.readAttributes

JVM
JRE7
1.4
@ExperimentalPathApi 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<String, Any?> having an entry for an each attribute read, where the key is the attribute name and the value is the attribute value.

See Also

Files.readAttributes