Top Description Interfaces Classes Enums
module java.base

Package java.nio.file.attribute


Interfaces and classes providing access to file and file system attributes.
Attribute views
Attribute views Description
java.nio.file.attribute.AttributeView Can read or update non-opaque values associated with objects in a file system
java.nio.file.attribute.FileAttributeView Can read or update file attributes
java.nio.file.attribute.BasicFileAttributeView Can read or update a basic set of file attributes
java.nio.file.attribute.PosixFileAttributeView Can read or update POSIX defined file attributes
java.nio.file.attribute.DosFileAttributeView Can read or update FAT file attributes
java.nio.file.attribute.FileOwnerAttributeView Can read or update the owner of a file
java.nio.file.attribute.AclFileAttributeView Can read or update Access Control Lists
java.nio.file.attribute.UserDefinedFileAttributeView Can read or update user-defined file attributes
java.nio.file.attribute.FileStoreAttributeView Can read or update file system attributes

An attribute view provides a read-only or updatable view of the non-opaque values, or metadata, associated with objects in a file system. The java.nio.file.attribute.FileAttributeView interface is extended by several other interfaces that provide views to specific sets of file attributes. FileAttributeViews are selected by invoking the java.nio.file.Files#getFileAttributeView method with a type-token to identify the required view. Views can also be identified by name. The java.nio.file.attribute.FileStoreAttributeView interface provides access to file store attributes. A FileStoreAttributeView of a given type is obtained by invoking the java.nio.file.FileStore#getFileStoreAttributeView method.

The java.nio.file.attribute.BasicFileAttributeView class defines methods to read and update a basic set of file attributes that are common to many file systems.

The java.nio.file.attribute.PosixFileAttributeView interface extends BasicFileAttributeView by defining methods to access the file attributes commonly used by file systems and operating systems that implement the Portable Operating System Interface (POSIX) family of standards.

The java.nio.file.attribute.DosFileAttributeView class extends BasicFileAttributeView by defining methods to access the legacy "DOS" file attributes supported on file systems such as File Allocation Table (FAT), commonly used in consumer devices.

The java.nio.file.attribute.AclFileAttributeView class defines methods to read and write the Access Control List (ACL) file attribute. The ACL model used by this file attribute view is based on the model defined by RFC 3530: Network File System (NFS) version 4 Protocol.

In addition to attribute views, this package also defines classes and interfaces that are used when accessing attributes:

Unless otherwise noted, passing a null argument to a constructor or method in any class or interface in this package will cause a NullPointerException to be thrown.

Since
1.7
External Specification
https://www.rfc-editor.org/info/rfc3530

Interface Summary

Modifier and TypeInterface and Description
public interface
AclFileAttributeView

A file attribute view that supports reading or updating a file's Access Control Lists (ACL) or file owner attributes.

public interface
AttributeView

An object that provides a read-only or updatable view of non-opaque values associated with an object in a filesystem.

public interface
BasicFileAttributes

Basic attributes associated with a file in a file system.

public interface
BasicFileAttributeView

A file attribute view that provides a view of a basic set of file attributes common to many file systems.

public interface
DosFileAttributes

File attributes associated with a file in a file system that supports legacy "DOS" attributes.

public interface
DosFileAttributeView

A file attribute view that provides a view of the legacy "DOS" file attributes.

public interface
FileAttribute<
The type of the file attribute value
T
>

An object that encapsulates the value of a file attribute that can be set atomically when creating a new file or directory by invoking the createFile or createDirectory methods.

public interface
FileAttributeView

An attribute view that is a read-only or updatable view of non-opaque values associated with a file in a filesystem.

public interface
FileOwnerAttributeView

A file attribute view that supports reading or updating the owner of a file.

public interface
FileStoreAttributeView

An attribute view that is a read-only or updatable view of the attributes of a java.nio.file.FileStore.

public interface
GroupPrincipal

A UserPrincipal representing a group identity, used to determine access rights to objects in a file system.

public interface
PosixFileAttributes

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

public interface
PosixFileAttributeView

A file attribute view that provides a view of the file attributes commonly associated with files on file systems used by operating systems that implement the Portable Operating System Interface (POSIX) family of standards.

public interface
UserDefinedFileAttributeView

A file attribute view that provides a view of a file's user-defined attributes, sometimes known as extended attributes.

public interface
UserPrincipal

A Principal representing an identity used to determine access rights to objects in a file system.

Class Summary

Modifier and TypeClass and Description
public class
AclEntry

An entry in an access control list (ACL).

public class
FileTime

Represents the value of a file's time stamp attribute.

public class
PosixFilePermissions

This class consists exclusively of static methods that operate on sets of PosixFilePermission objects.

public abstract class
UserPrincipalLookupService

An object to lookup user and group principals by name.

public class
UserPrincipalNotFoundException

Checked exception thrown when a lookup of UserPrincipal fails because the principal does not exist.

Enum Summary

Modifier and TypeEnum and Description
public enum
AclEntryFlag

Defines the flags for used by the flags component of an ACL entry.

public enum
AclEntryPermission

Defines the permissions for use with the permissions component of an ACL entry.

public enum
AclEntryType

A typesafe enumeration of the access control entry types.

public enum
PosixFilePermission

Defines the bits for use with the permissions attribute.