- 
- All Superinterfaces:
- AttributeView,- FileAttributeView
 - All Known Subinterfaces:
- AclFileAttributeView,- PosixFileAttributeView
 
 public interface FileOwnerAttributeView extends FileAttributeView 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 getOwnerorsetOwnermethods may be used to read or update the owner of the file.The getAttributeandsetAttributemethods 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 aUserPrincipal.- Since:
- 1.7
 
- 
- 
Method SummaryAll Methods Instance Methods Abstract Methods Modifier and Type Method Description UserPrincipalgetOwner()Read the file owner.Stringname()Returns the name of the attribute view.voidsetOwner(UserPrincipal owner)Updates the file owner.
 
- 
- 
- 
Method Detail- 
nameString name() Returns the name of the attribute view. Attribute views of this type have the name"owner".- Specified by:
- namein interface- AttributeView
- Returns:
- the name of the attribute view
 
 - 
getOwnerUserPrincipal getOwner() throws IOException Read the file owner.It is implementation specific if the file owner can be a group.- Returns:
- the file owner
- Throws:
- IOException- if an I/O error occurs
- SecurityException- In the case of the default provider, a security manager is installed, and it denies- RuntimePermission- ("accessUserInformation")or its- checkReadmethod denies read access to the file.
 
 - 
setOwnervoid 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- the new file owner
- Throws:
- IOException- if an I/O error occurs, or the- ownerparameter is a group and this implementation does not support setting the owner to a group
- SecurityException- In the case of the default provider, a security manager is installed, and it denies- RuntimePermission- ("accessUserInformation")or its- checkWritemethod denies write access to the file.
 
 
- 
 
-