APIdia Launch Partner
Top Description Methods
java.nio.file.attribute

public Interface FileOwnerAttributeView

extends FileAttributeView
Known Direct Subinterfaces
java.nio.file.attribute.PosixFileAttributeView, java.nio.file.attribute.AclFileAttributeView
Known Direct Implementers
sun.nio.fs.FileOwnerAttributeViewImpl
Imports
java.io.IOException

A file attribute view that supports reading or updating the owner of a file. This file attribute view is intended for file system implementations that support a file attribute that represents an identity that is the owner of the file. Often the owner of a file is the identity of the entity that created the file.

The getOwner or setOwner methods may be used to read or update the owner of the file.

The getAttribute and setAttribute methods may also be used to read or update the owner. In that case, the owner attribute is identified by the name "owner", and the value of the attribute is a UserPrincipal.

Since
1.7

Method Summary

Modifier and TypeMethod and Description
public UserPrincipal

Returns:

the file owner
getOwner
()

Read the file owner.

public String
name()

Redeclares java.nio.file.attribute.AttributeView.name.

Returns the name of the attribute view.

public void
setOwner(UserPrincipal
the new file owner
owner
)

Updates the file owner.

Method Detail

getOwnerback to summary
public UserPrincipal getOwner() throws IOException

Read the file owner.

It is implementation specific if the file owner can be a group.

Returns:UserPrincipal

the file owner

Exceptions
IOException:
if an I/O error occurs
nameback to summary
public String name()

Redeclares java.nio.file.attribute.AttributeView.name.

Returns the name of the attribute view. Attribute views of this type have the name "owner".

Annotations
@Override
setOwnerback to summary
public void setOwner(UserPrincipal owner) throws IOException

Updates the file owner.

It is implementation specific if the file owner can be a group. To ensure consistent and correct behavior across platforms it is recommended that this method should only be used to set the file owner to a user principal that is not a group.

Parameters
owner:UserPrincipal

the new file owner

Exceptions
IOException:
if an I/O error occurs, or the owner parameter is a group and this implementation does not support setting the owner to a group