Top Description Methods
java.nio.file.attribute

public Interface PosixFileAttributes

extends BasicFileAttributes
Known Direct Implementers
sun.nio.fs.UnixFileAttributes
Imports
java.util.Set

File attributes associated with files on file systems used by operating systems that implement the Portable Operating System Interface (POSIX) family of standards.

The POSIX attributes of a file are retrieved using a PosixFileAttributeView by invoking its readAttributes method.

Since
1.7

Method Summary

Modifier and TypeMethod and Description
public GroupPrincipal

Returns:

the file group owner
group
()

Returns the group owner of the file.

public UserPrincipal

Returns:

the file owner
owner
()

Returns the owner of the file.

public Set<PosixFilePermission>

Returns:

the file permissions
permissions
()

Returns the permissions of the file.

Inherited from java.nio.file.attribute.BasicFileAttributes:
creationTimefileKeyisDirectoryisOtherisRegularFileisSymbolicLinklastAccessTimelastModifiedTimesize

Method Detail

groupback to summary
public GroupPrincipal group()

Returns the group owner of the file.

Returns:GroupPrincipal

the file group owner

See Also
PosixFileAttributeView#setGroup
ownerback to summary
public UserPrincipal owner()

Returns the owner of the file.

Returns:UserPrincipal

the file owner

See Also
PosixFileAttributeView#setOwner
permissionsback to summary
public Set<PosixFilePermission> permissions()

Returns the permissions of the file. The file permissions are returned as a set of PosixFilePermission elements. The returned set is a copy of the file permissions and is modifiable. This allows the result to be modified and passed to the setPermissions method to update the file's permissions.

Returns:Set<PosixFilePermission>

the file permissions

See Also
PosixFileAttributeView#setPermissions