Spec-Zone.ru › OpenJDK 27

Interface PosixFileAttributes

All Superinterfaces:
BasicFileAttributes
public interface PosixFileAttributes extends BasicFileAttributes
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 Type Method Description
GroupPrincipal group()
Returns the group owner of the file.
UserPrincipal owner()
Returns the owner of the file.
Set<PosixFilePermission> permissions()
Returns the permissions of the file.

Methods declared in interface BasicFileAttributes

creationTime, fileKey, isDirectory, isOther, isRegularFile, isSymbolicLink, lastAccessTime, lastModifiedTime, size
Modifier and Type Method Description
FileTime creationTime()
Returns the creation time.
Object fileKey()
Returns an object that uniquely identifies the given file, or null if a file key is not available.
boolean isDirectory()
Tells whether the file is a directory.
boolean isOther()
Tells whether the file is something other than a regular file, directory, or symbolic link.
boolean isRegularFile()
Tells whether the file is a regular file with opaque content.
boolean isSymbolicLink()
Tells whether the file is a symbolic link.
FileTime lastAccessTime()
Returns the time of last access.
FileTime lastModifiedTime()
Returns the time of last modification.
long size()
Returns the size of the file (in bytes).

Method Details

owner

UserPrincipal owner()
Returns the owner of the file.
Returns:
the file owner
See Also:
  • FileOwnerAttributeView.setOwner(UserPrincipal)

group

GroupPrincipal group()
Returns the group owner of the file.
Returns:
the file group owner
See Also:
  • PosixFileAttributeView.setGroup(GroupPrincipal)

permissions

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:
the file permissions
See Also:
  • PosixFileAttributeView.setPermissions(Set)

Report a bug or suggest an enhancement
For further API reference and developer documentation see the Java SE Documentation, which contains more detailed, developer-targeted descriptions with conceptual overviews, definitions of terms, workarounds, and working code examples. Other versions.
Java is a trademark or registered trademark of Oracle and/or its affiliates in the US and other countries.
Copyright © 1993, 2026, Oracle and/or its affiliates, 500 Oracle Parkway, Redwood Shores, CA 94065 USA.
All rights reserved. Use is subject to license terms and the documentation redistribution policy.

© 1993, 2025, Oracle and/or its affiliates. All rights reserved.
Documentation extracted from Debian's OpenJDK Development Kit package.
Licensed under the GNU General Public License, version 2, with the Classpath Exception.
Various third party code in OpenJDK is licensed under different licenses (see Debian package).
Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.

Spec-Zone.ru

Настройки Оффлайн Что нового Помощь О нас
Spec-Zone .ru
спецификации, руководства, описания, API