This {@code FileAttributeView} provides a view of a file's user-definedattributes as a set of name/value pairs, where the attribute name is represented by a {@code String}. An implementation may require to encode and decode from the platform or file system representation when accessing the attribute. The value has opaque content. This attribute view defines the {@link #read read} and {@link #write write} methods to read the value intoor write from a {@link ByteBuffer}. This {@code FileAttributeView} is notintended for use where the size of an attribute value is larger than {@link Integer#MAX_VALUE}.
User-defined attributes may be used in some implementations to store security related attributes so consequently, in the case of the default provider at least, all methods that access user-defined attributes require the {@code RuntimePermission("accessUserDefinedAttributes")} permission when asecurity manager is installed.
The {@link java.nio.file.FileStore#supportsFileAttributeView supportsFileAttributeView} method may be used to test if a specific {@link java.nio.file.FileStore FileStore} supports the storage of user-definedattributes.
Where dynamic access to file attributes is required, the {@link java.nio.file.Files#getAttribute getAttribute} method may be used to readthe attribute value. The attribute value is returned as a byte array (byte[]). The {@link java.nio.file.Files#setAttribute setAttribute} method may be usedto write the value of a user-defined attribute from a buffer (as if by invoking the {@link #write write} method), or byte array (byte[]). @since 1.7
|
|
|
|